Copy link to clipboard
Copied
Question, how do you go about getting the XML ID and then setting it via a script?
Copy link to clipboard
Copied
Basically what i've found is that even when using the XML naming, there is only one function to get the layers:
app.activeDocument.layers.getByName('Layer');
app.activeDocument.layers.getByName('Layer 1');
app.activeDocument.layers.getByName('Layer 2');If the names you see in illustrator Layers panel are Layer_1 Layer_2 etc, you still get them with same function, and you have to ignore _ sign.
When i'm copying layers it adds copy to the layer name, so i'm not sure how do you copy those, so it's adding _1 etc.
In theory it seems doable, could you please get us some files to check with?
Copy link to clipboard
Copied
@lumenn, what I've seen is that when you have XLM id off you can have duplicate layer/objects names, then when you switch xlm id on, illustrator adds _1_, _2_, etc to duplicates.
other than that duplicating always adds "copy"
Copy link to clipboard
Copied
So we were able to make a script that in large cleaned up the layers/objects pending the file was built in XML first then we changed the units from XML ID to Object Name.
Ran the rename script against the layer names, this in bulk changes the core layer names
Then changed the back to XML ID in units
But yes, this duplication thing is a huge pain, adding on suffix of _1_, _2_, _3_ etc where ever we duplicated a layer group.
My original through was, it disappeared when we made the object name unique, but it has tagged it somehow in XML ID
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more