1

How can I quickly turn all objects of a layer (text boxes, shapes, lines, etc.) to independent layers in InDesign ?

1

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;
}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.