Built-in names
| Name | What it is |
|---|---|
time | The current time in seconds. |
value | The property's own value now, before the expression. |
thisLayer | The layer the expression is on. |
thisComp | The comp. |
thisProperty | The property the expression drives. |
Math | Math functions and constants. See Math and conversion. |
Layer members can also be used bare, as in AE: transform, position, scale, rotation, opacity, anchorPoint, xRotation, yRotation, zRotation, inPoint, outPoint, startTime, index, name, width, height, effect, hasParent, parent.
Statements
var x = …;(letandconstwork the same). Assign with=,+=,-=,*=,/=.if (…) { … } else { … }.- The last line's value is the result.
- Comments:
// …and/* … */.
Operators
Arithmetic + - * / %, comparison == != < <= > >= (also === / !==), logic && || !, and the conditional a ? b : c.
Values
- Numbers and true/false.
- Arrays as vectors — up to four items (positions, scales, colours).
[100, 200] + [10, 10]adds item by item; a number with an array applies to each item..lengthgives the count;v[0]an item. - Strings in
"…"or'…', joined with+;.length,.toUpperCase(),.toLowerCase(). Numbers have.toFixed(n)(0–20 decimals).
Result shape
A number fills every dimension of the property. A short array is padded with the property's own value (AE's rule); a long one is cut.
Not supported
for, while, do, function, return, new, this, class, and ++ / -- (write x = x + 1).