Mobile app version of vmapp.org
Login or Join

Login to follow query

More posts by @Tiffany317

1 Comments

Sorted by latest first Latest Oldest Best

 

@Yeniel278

This tiny script should do what you want:
#target InDesign

var doc = app.activeDocument;

for (var i = 1; i < doc.pageItems.length; i++) {
var newLayer = doc.layers.add();
doc.pageItems[i].itemLayer = newLayer;
}


For each page item it finds in the document, it creates a new layer and moves the item to the new layer.

Edit: As you actually need all objects of a layer to move to new layers, not all objects of the doc, the script would look like this instead:
#target InDesign

var doc = app.activeDocument;
var myLayer = doc.layers.item("Your layer's name");

for (var i = myLayer.pageItems.length - 1; i >= 1; i--) {
var newLayer = doc.layers.add();
myLayer.pageItems[i].itemLayer = newLayer;
}

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme