Are there any parameters that you can think of that would cause this script not to function properly?
When I try the script on the provided JET_X_Layers.ai file... it works like a champ - but when I try and use it on a file that I am wanting to separate into top layers... I continually get a script alert saying "1 Top Level Layer(s)", and nothing seems to change in my layer palette.
What OS and version of AI? I just tried it on a file. It takes a couple of steps. First select each master layer in your document and run the Release to Layers (Sequence) from the flyout menu. Then run the script twice. The first time it should tell you the number of atarting layers and the second it will move the layers to the top layer list.
I had the same problem. In Illy CS6, I found a way though.
Unfortunately, the release to layers command doesn't name the sub-layers according to the objects they're in. Aynone has a fix for that?
here's a script to rename Sublayers (based on the first object's name), do it like this
1. release layers (ie Layer 1)
1.1 activate (highlight) layer (Layer 1)
1.2 run script
2. select them all...
3. drag the whole bunch...
// renameSublayers.jsx - carlos canto
// http://forums.adobe.com/message/5403549?tstart=0#5403549
var idoc = app.activeDocument;
var ilayer = idoc.activeLayer;
for (i=0; i<ilayer.layers.length; i++) {
var isublayer = ilayer.layers[i];
isublayer.name = isublayer.pageItems[0].name;
}
North America
Europe, Middle East and Africa
Asia Pacific