Write & Apply an Expression
The starting job: drive one property with an expression, confirm it works, and commit it.
The task
You have a property — say a layer's Position — and you want an expression on it. Three things have to happen, in this order:
- Get an editing surface for that property's expression.
- Write the code, including any references to other properties.
- Find out whether After Effects accepts it, and commit it if so.
How it goes in plain After Effects
- Option/Alt-click the property's stopwatch in the Timeline. The expression is created empty and the caret lands in the inline expression field beside the property.
- Type into that field. It is a plain text field — one line tall until you drag it taller — with no syntax colouring, no completion, and no signature help.
- Reference another property by dragging the expression pickwhip (the spiral beside the field) onto that property in the Timeline. It writes the reference for you, inside the composition you're in.
- Commit with
Enteron the numeric keypad, or by clicking anywhere outside the field.
i
Committing is the change. There is no way to try the expression and get the property back — if you don't like the result, you undo.
- If After Effects rejects it, it says so and switches the expression off, leaving a warning marker on the property. Re-open the field to read the message, fix, commit again. That loop is the whole feedback mechanism: nothing tells you about a problem until you commit.
What changes with eXLib
- You write in a real editor, against a language that knows the AE dialect.
- Problems surface while you type, not after you commit.
- Audition asks After Effects itself for a verdict and puts the property back, so the "does this work?" question is answered before anything is committed.
- Apply commits the expression and any controls it declares as one undo group.
✓
The status bar names the property Apply and Audition will use, with its
dimension chip — 2D for Position. Read it before you click anything: it is the same
live selection those two verbs re-read at the moment you press them.
Step by step
| Step | In plain After Effects | With eXLib |
|---|---|---|
| 1. Choose the property | Select it in the Timeline | Select it in the Timeline — the panel's status bar names it and shows its dimension |
| 2. Get an editing surface | Option/Alt-click the stopwatch; type in the inline field | Click into the editor — a full Monaco surface, in its own tab |
| 3. Write the code | Plain text: no colouring, no completion | Completions on ., ", ' or Ctrl+Space, merging AE's API, your own symbols, and the real layer and effect names in your comp |
| 4. Reference another property | Drag AE's pickwhip onto the property, in this comp | ⌃⌘R opens the picker: click a leaf to insert it, and browse any comp in the project without moving AE |
| 5. Find mistakes | Nothing until you commit | Live diagnostics as you type; hover an underline for the message; F8 / Alt+F8 walk them |
| 6. Try it without committing | Not available — committing is the change | IDE → Audition, or ⌃⌘E: AE's own verdict plus the sampled value, property restored and the restore verified |
| 7. Commit | Enter on the keypad, or click away |
Apply on the toolbar |
| 8. Read the verdict | AE disables the expression and marks the property if it failed | A toast naming the property written to — and, on failure, AE's own error text |
| 9. Undo | Cmd+Z in After Effects |
Cmd+Z once in After Effects — expression and any created controls together |