Copy link to clipboard
Copied
Copy link to clipboard
Copied
var doc = app.activeDocument;
doc.layers.add().name = "Images";
doc.layers.add().name = "Linked Files";
doc.layers.add().name = "Other";
for (var i = 0; i < doc.pageItems.length; i++) {
if (doc.pageItems[i].typename == "RasterItem") {
move(doc.pageItems[i], doc.layers["Images"]);
} else if (doc.pageItems[i].typename == "PlacedItem") {
move(doc.pageItems[i], doc.layers["Linked Files"]);
} else {
move(doc.pageItems[i], doc.layers["Other"]);
}
}
function move(what, where) {
what.move(where, ElementPlacement.PLACEATEND);
}
Copy link to clipboard
Copied
Copy link to clipboard
Copied
A little side note:
The script from @femkeblanco works exactly as you described. Unfortunately, you forgot to mention that there are dozens of nested clipping groups in your file and furthermore compound path items in some groups exists.
It might also be helpful to specify the correct Illustrator version. Because not every helper here in the forum always uses the latest version.
Copy link to clipboard
Copied
Thanks For your Reply
You are correct , I forgot to mention that there are dozens of nested clipping groups in your file and furthermore compound path items in some groups exists.
What is the script in this case ?
I use illustrator 2023