I’m working on a script to duplicate a layer in all documents in a book. The script compiles all layers which are common across all documents, then allows the user to select the ones to duplicate. How can I within the script rename the layer copy at the same time?
Here’s the snippet:
//if the box is checked
if (checkList[check].checkedState == true)
{
//duplicate checked layer
docList[d].layers.item (layerList[check]).duplicate()
//How do I rename the layer which was created?
//does not work: docList[d].layers.previousItem (layerList[check]).name = “Unpriced”;
}
Any pointers?
Sorry if this is super basic, I’ve jsut started.