Answered
How to place a newly created layer at the bottom of all layers?
I created a new “guides” layer and want to place it at the bottom.
How do I do that?
This catch seems incorrect; it should check whether this layer already exists.
https://www.indesignjs.de/extendscriptAPI/indesign-latest/#Layers.html
var myLayer = myDocument.layers.item("guides");
try {
myLayerName = myLayer.name;
}
catch (myError) {
var myLayer = myDocument.layers.add({ name: "guides" });
}
