Copy link to clipboard
Copied
Hi there
I was wondering if anyone knew of a script that would allow me to add a sequential numbering to multiple layers? i'm am working on files that have layers (some up to 200+) that are already named by their pantone refs, i have to organise them into their correct order and then add a sequential prefix of '1_', '2_' , '3_' etc (the underscore needed to seperate them from the numbers of the pantones) this is needed to be done from the bottom layer going up. I have included a screengrab of 10 layers to show you what i am currently doing manually, any help would be much appreciated as i have hundreds of artworks with hundreds of layers to sort and automation would literally save me weeks of time.
many thanks in advance
Nick
Copy link to clipboard
Copied
#target illustrator
var doc = app.activeDocument;
var layerCount = doc.layers.length;
for (var j = 0; j < layerCount; j++) {
layer = doc.layers[j];
layer.name = j.toString() + "_" + layer.name;
}
Copy link to clipboard
Copied
Salut!
"cela doit être fait à partir de la couche inférieure qui monte"
#target illustrator
var doc = app.activeDocument;
var layerCount = doc.layers.length;
for (var j = layerCount-1, k = 1; j >= 0; j--, k++) {
var layer = doc.layers[j];
layer.name = k + "_" + layer.name;
}
Copy link to clipboard
Copied