ae_run_jsx
Execute ExtendScript code in After Effects to automate compositing, inspect layers, and modify properties. Pass data via args; long runs return a commandId for later retrieval.
Instructions
Run arbitrary ExtendScript (ES3 JavaScript) inside After Effects. The value of the last expression is returned (AE objects come back as short summaries). Pass data through args (available as the args variable) instead of pasting it into the code. Helpers: mcp.findComp(nameOrId?), mcp.findLayer(comp, nameOrIndex), mcp.activeComp(), mcp.layerType(layer), mcp.projectInfo(); lib.prop(layer, 'Transform/Position'), lib.setValue(prop, value, time?), lib.color('#ff8800'), lib.tree(propertyGroup, depth, withValues). The whole call is one undo step. If it runs longer than the timeout, a commandId is returned: fetch the result with ae_get_result, do not re-send the code.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | Optional data exposed to the code as `args`. | |
| code | Yes | ExtendScript code. ES3 only: var, no arrow functions, no let/const. | |
| timeoutMs | No | How long to wait before returning a commandId (default 30000, max 3600000). |