I am working on a very large .ai file of a baseball stadium render. It contains many small sections and box seats that need named and numbered in this format: section::100, section::101, ... and so on. Right now, I'm having to go through and rename each path individually. Is there a script that will save me TONS of time by automating this for me?
I found this one on here, which is a good start for what I need, but it doesn't let me only number selected paths, nor does it let me start the numbering where I want (say at 100 and go up from there).
#target illustrator
var docRef = app.activeDocument;
var newName = prompt ("What's the base of the new name","base");
var myNB = docRef.pathItems.length;
for ( i = 1 ; i < myNB; i++)
{
var finalName = newName + i;
docRef.pathItems[i].name = finalName
}
Thanks in advance!!
Im not convinced that a script is going to work for what you want to do… You can work with selected objects and check that they are 'text frames' you can also prompt for a start number and check it's a number before using it. Where you 'may' fall into difficulty is with the stacking order of the objects within the drawing. Your sample script will number in this order as is…
Thanks for the reply Mark, but you may be misunderstanding one aspect.. I don't need to rename/edit text boxes. I make a separate layer called "labels" and manually change each one. I can deal with that, if I have to. I'm talking about renaming and numbering paths. Here's a screen of what I'm dealing with...
... or, I could could refer to them as path layers... I need the names of the path layers to be named and numbered. Remember, the script I posted above mostly works for what I need it to do, it just simplay renames every path in the document (I need selected paths only), and starts the numbering at 0 (I need to start the numbering at the number I choose).
I have taken a quick guess at what you want but Im supposed to be busy at work… ![]()
#target illustrator
var docRef = app.activeDocument;
var newName = prompt ("What's the base of the new name","base");
var stNumb = prompt ("What's the start number","1");
var myNB = docRef.selection.length;
for (var i = 0 ; i < myNB; i++) {
var finalName = newName + stNumb;
if (docRef.selection[i].typename == 'PathItem') {
docRef.selection[i].name = finalName;
stNumb++;
}
}
Haha.. hopefully you can use it yourself. Hey a quick, dumb question I hope you don't mind answering in this thread... Is there a way to quickly select/target paths within the layers pallete?.. I can Shift+click, but it makes me do it one path at a time. No big deal, but would be a little faster if there was a way.
Then I'll leave you alone, promise ![]()
North America
Europe, Middle East and Africa
Asia Pacific