An Adobe Illustrator JS script for creating new layers from a selection of objects.
An Adobe Illustrator JS script that, given a selection of objects in an active document, separately moves them to new layers.
Whether you’re a tidy and clean designer or not, it might be the chance that — once you’re quite satisfied with your current project — your Illustrator artboard is quite messy. You know: a bit of hurry, deadlines approaching, the creative process — stuff like that. This piece of code helps you clean it up.
Just select the objects you want to keep and run this script: they will be put on top of your layers stack (each of them inside its own new layer), keeping their original Z-order.
It comes particularly handy when you need to prepare you
.ai
file to be imported into some other Adobe Creative Suite software (i.e. After Effects — all the pieces of art you want to animate will be ready for the useful AEComposition
option for importing layers.)
Requires moveToNewLayers.jsx
, getEmptyLayers.jsx
, deleteEmptyLayers.jsx
and deleteNotMovedLayers.jsx
in the /helpers
folder
An active .ai
document with one or more objects selected.
It couldn’t be easier:
This script comes with two additional “cleaning” options:
deleteEmptyLayers.jsx
is inspired by this Ai Scripts example.