Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Error: Syntax Error: Unexpected token 'else'

New Here ,
May 18, 2021 May 18, 2021

Hello! I'm brand new to Adobe After Effects and just used a mockup, but I'm getting a syntax error on line 1. I don't know much about codeing so I was hoping sombody smarter than me might know. Here's the error and code:

lieeeessswww_0-1621334898161.pngexpand imagelieeeessswww_1-1621334907937.pngexpand image

if(thisComp.layer("Color & Value Control").effect("Slider Control 01")("ADBE Slider Control-0001")>>0) thisComp.layer("Color & Value Control").effect("Percents Opacity")("ADBE Slider Control-0001") else 0;

TOPICS
Crash , Error or problem , Expressions , Scripting
940
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , May 18, 2021 May 18, 2021

try this:

(thisComp.layer("Color & Value Control").effect("Slider Control 01")("ADBE Slider Control-0001")>0) ? thisComp.layer("Color & Value Control").effect("Percents Opacity")("ADBE Slider Control-0001") : 0

 

or

 

Math.max(0,thisComp.layer("Color & Value Control").effect("Slider Control 01")("ADBE Slider Control-0001"))

Translate
Community Expert ,
May 18, 2021 May 18, 2021
LATEST

try this:

(thisComp.layer("Color & Value Control").effect("Slider Control 01")("ADBE Slider Control-0001")>0) ? thisComp.layer("Color & Value Control").effect("Percents Opacity")("ADBE Slider Control-0001") : 0

 

or

 

Math.max(0,thisComp.layer("Color & Value Control").effect("Slider Control 01")("ADBE Slider Control-0001"))

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines