Run ExtendScript
ae_run_scriptExecute arbitrary ExtendScript in After Effects to handle masks, text animators, and other unsupported operations. Pass args and return JSON results.
Instructions
Run arbitrary ExtendScript inside After Effects. This is the escape hatch for anything the other tools don't cover — masks, shape operators, text animators, puppet pins, the lot.
The script body runs as a function: use return <value> to send JSON-serialisable data back. The full AE scripting API is available (app, app.project, ...), plus the AEMCP helpers used by this server: AEMCP.comp(ref), AEMCP.layer(comp, ref), AEMCP.prop(root, path), AEMCP.color(hex), AEMCP.time(comp, t), AEMCP.serializeLayer(layer), AEMCP.setKeys(prop, comp, keys, opts).
Pass args to hand data to the script: it arrives as the ARGS variable (null when omitted). Prefer that over pasting values into the source — it keeps quoting and non-ASCII text correct.
Remember: this is ES3. No JSON, no arrow functions, no let/const, no Array.forEach.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | Any JSON value, available to the script as `ARGS`. | |
| script | Yes | ExtendScript source. Use `return` to produce a result. | |
| undoLabel | No | Wrap the script in an undo group with this label. Omit for read-only scripts. | |
| timeoutSeconds | No | Default: 120. |