0
Expression Error: If Else not working???
Explorer
,
/t5/after-effects-discussions/expression-error-if-else-not-working/td-p/11149291
May 21, 2020
May 21, 2020
Copy link to clipboard
Copied
V = effect("Slider Control")("Slider");
if (V > 0) X = 100 else X = 0;
[X,X]
This is just about as simple as it gets but I get this error:
Error: Syntax error: Unexpected token else (And this is about line 2 obviously)
What? I could swear this is similar to what I've done before. Help me out!
TOPICS
Error or problem
,
Expressions
,
How to
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Atte J.
AUTHOR
Explorer
,
/t5/after-effects-discussions/expression-error-if-else-not-working/m-p/11149316#M112704
May 21, 2020
May 21, 2020
Copy link to clipboard
Copied
Never mind, I got it. Curly brackets... {100} {0} or legacy ExtendScript in project settings.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
LATEST
/t5/after-effects-discussions/expression-error-if-else-not-working/m-p/11149506#M112710
May 21, 2020
May 21, 2020
Copy link to clipboard
Copied
Or:
X = (V > 0) ? 100 : 0;
Dan
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

