A tiny After Effects script that parents every selected layer to the last layer you select.
Select any number of layers, run the script, and:
- The last layer you select becomes the parent.
- Every other selected layer becomes its child.
- It all happens inside a single undo step.
No dialogs, no fuss — just instant parenting. Great as a hotkey for rigging, nulls, and quick scene setup.
- Place
ParentToLast.jsxin your Scripts folder and run via File → Scripts → ParentToLast.jsx:Windows: C:\Program Files\Adobe\Adobe After Effects [version]\Support Files\Scripts\ macOS: /Applications/Adobe After Effects [version]/Scripts/
- Keep the
.jsxanywhere and trigger it from your hotkey tool of choice, e.g. AutoHotkey:run, "<path-to-AfterFX.exe>" -r "C:\path\to\ParentToLast.jsx"
- Open a composition.
- Select 2 or more layers — the last layer you select is the parent.
- Run the script.
- Done! Every other selected layer is now parented to that last layer.
✅ Select Layer A (becomes child)
✅ Select Layer B (becomes child)
✅ Select Layer C (last selected) ← becomes the PARENT
🔘 Run ParentToLast
Result: Layers A and B are now parented to Layer C.
- Adobe After Effects (any version with scripting support)
- At least 2 selected layers in an active composition
- Order matters — the last layer you select is always the parent.
- Relies on After Effects returning
selectedLayersin selection order. If your AE build returns a different order and the wrong layer ends up as parent, swap the parent tosel[0]and loop from index1.
MIT