Copy link to clipboard
Copied
Can we add Artboard Ref.no at starting of the each selected artboard name. I don’t want to lost given custom name. just to add Ref. No at starting of the custom artboard name
Maybe you will find this script useful. It has a lot more options https://github.com/creold/illustrator-scripts/blob/master/jsx/BatchRenamer.jsx
Copy link to clipboard
Copied
Maybe you will find this script useful. It has a lot more options https://github.com/creold/illustrator-scripts/blob/master/jsx/BatchRenamer.jsx
Copy link to clipboard
Copied
Wow, Great, absolutely working
Sergey Osokin, you given me lot lot than I was expecting.
Thank you so much 🙂
Copy link to clipboard
Copied
Hello Sergey Osokin,
How to define color for Numbers as you shown in animation?
Copy link to clipboard
Copied
I added a variable with color to the function. This improvement is not available on GitHub
function showAbIndex(doc, lyrName) {
var tmpLayer;
try {
tmpLayer = doc.layers.getByName(lyrName);
} catch (e) {
tmpLayer = doc.layers.add();
tmpLayer.name = lyrName;
}
var color = new RGBColor();
color.red = 255;
for (var i = 0, len = doc.artboards.length; i < len; i++) {
doc.artboards.setActiveArtboardIndex(i);
var currAb = doc.artboards[i],
abWidth = currAb.artboardRect[2] - currAb.artboardRect[0],
abHeight = currAb.artboardRect[1] - currAb.artboardRect[3],
label = doc.textFrames.add(),
labelSize = (abWidth >= abHeight) ? abHeight / 2 : abWidth / 2;
label.contents = i + 1;
// 1296 pt limit for font size in Illustrator
label.textRange.characterAttributes.size = (labelSize > 1296) ? 1296 : labelSize;
label.textRange.characterAttributes.fillColor = color;
label.position = [currAb.artboardRect[0], currAb.artboardRect[1]];
label.move(tmpLayer, ElementPlacement.PLACEATBEGINNING);
}
redraw();
}
Copy link to clipboard
Copied
Uploaded a new version to Github, where you can set the index color in "CFG.idxColor: [255, 0, 0]"
Copy link to clipboard
Copied
Thank You so much, this will save time to review pages while renaming the artboards at complex artwork
Copy link to clipboard
Copied
How can this be run in Adobe Illustrator? I'm new to using scripts.
Copy link to clipboard
Copied
Disregard! I found the installation instructions. Apologies for asking too quick
Copy link to clipboard
Copied
hello sergey, very useful script, like all the ones you've created, but I don't understand why only the "find/replace" function works for me, however very useful. Unfortunately I can't use the "suffix/prefix" functions instead, nothing happens, it doesn't behave like in your example. Probably I'm doing something wrong... Thanks in advance
------
sorry... I found out now that surely it's my machine that has problems (macOS Mojave + illustrator 25.4.8), I tried it on another more up-to-date computer with macOS monterey and illustrator 27.4.1 and everything works perfectly!, sorry again for the hasty request...
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Hi Sergey, I wrote you a message from your profile, however I discovered how to use it without errors, thanks again!
Copy link to clipboard
Copied
This would work:
function artboardRef() {
var aDoc = app.activeDocument;
for (i = 0; i < aDoc.artboards.length; i++) {
var abName = aDoc.artboards[i].name;
aDoc.artboards[i].name = (i + 1) + '_' + abName;
}
}
artboardRef();
Copy link to clipboard
Copied
Yes, Its working as expect. Thank you so much.
Copy link to clipboard
Copied
It will be great, if this script works only at selected artboards in the panel, is it possible ?
Copy link to clipboard
Copied
No. Selected layers and artboards in panels are used by the user for manual movement, but this selection is not available to the API.
Copy link to clipboard
Copied
Its OK, but you solved my Big problem of Renaming Artboards