Mobile app version of vmapp.org
Login or Join
Lee3735518

: Does anyonw have a script for adding sequential numbers (as a prefix) to layer names in Illustrator I'm looking for a script that can add sequential numbers as a prefix to existing names of

@Lee3735518

Posted in: #AdobeIllustrator #IllustratorScripting

I'm looking for a script that can add sequential numbers as a prefix to existing names of layers in Adobe Illustrator.

Does anyone here known of one? Or, could you direct me to where I may find one?

Thanks in advance,
Dave

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Lee3735518

1 Comments

Sorted by latest first Latest Oldest Best

 

@Cugini998

Perhaps this does the trick for you?
#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;
}


and same thing in reverse
#target illustrator

var doc = app.activeDocument;
var layerCount = doc.layers.length;
for (var j = 0; j < layerCount; j++) {
layer = doc.layers[layerCount-1-j];
layer.name = j.toString() + "_" + layer.name;
}

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme