safe_rename
Rename After Effects layers or comps while updating name-based expression references to prevent broken links. Use dry run to preview affected expressions before applying changes.
Instructions
Expression-safe rename of a LAYER (or a comp). A plain rename silently breaks name-based expression references — this runs the 5-step: (1) scan every comp for expressions referencing layer("oldName"), (2) build the update map, (3) rewrite oldName->newName in those expressions FIRST, (4) rename the layer, (5) force re-enable any expression AE disabled during the change. dryRun (default false) reports which expressions WOULD change without touching anything. For a comp rename pass renameComp instead of layer; the comp is renamed but cross-comp comp("oldName") references are NOT auto-updated (called out in the result note). Returns { renamed, from, to, kind, expressionsUpdated:[{comp,layer,prop}], reEnabled:[...], dryRun, note? }.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"newName": "<newName>"
},
"name": "safe_rename"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| comp | No | Comp: name (string), or { id: N } for duplicate-name-safe stable-id addressing. Defaults to active comp. | |
| layer | No | Layer: name (string), 1-based index (integer), or { id: N } for duplicate-name-safe stable-id addressing. | |
| dryRun | No | Report affected expressions without changing anything. | |
| newName | Yes | The new name. | |
| instance | No | Target a specific AE when more than one is connected (e.g. "2026", "2025", or a major like "26"). Omit when only one AE is open — see list_instances. | |
| renameComp | No | Rename a COMP (by name, id, or { id: N }) instead of a layer. Mutually exclusive with `layer`. |