Copy link to clipboard
Copied
I'm looking to create a script or action that renames my artboards to the filename + a specific suffix.
In the example below with the file name U101-G001.pdf I'd like the artboards to:
U101-G001_fty
U101-G001_th
is this possible?
This is pretty close. I don't need the extention. I was able to cobble below together and it works, but lots of code.
// Add filename to artboard plus custom suffix, set below "New Name 1", "New Name 2", "New Name 3"
var aDoc = app.activeDocument;
var which_artBoard_to_rename = 1; // set number of the artboard you want to change - should be 1 or higher; max = max number of artboards in your document
abIdx = which_artBoard_to_rename - 1;
aDoc.artboards[0].name = aDoc.name.substring(0,aDoc.name.last
...Copy link to clipboard
Copied
var doc1 = app.activeDocument;
doc1.artboards[0].name = doc1.name + "_fty";
doc1.artboards[1].name = doc1.name + "_th";
Alternatively:
var suffix = ["_suffix1", "_suffix2", "_suffix3"/*et cetera*/];
var doc1 = app.activeDocument;
var abs1 = doc1.artboards;
for (var i = 0; i < abs1.length; i++) {
abs1[i].name = doc1.name + suffix[i];
}
Copy link to clipboard
Copied
Yours is good - but not exactly what the OP wants.
I think it should be more like that:
var doc1 = app.activeDocument;
var nme = doc1.name.replace(/\.pdf/i, "");
doc1.artboards[0].name = nme + "_fty";
doc1.artboards[1].name = nme + "_th";
Copy link to clipboard
Copied
This is pretty close. I don't need the extention. I was able to cobble below together and it works, but lots of code.
// Add filename to artboard plus custom suffix, set below "New Name 1", "New Name 2", "New Name 3"
var aDoc = app.activeDocument;
var which_artBoard_to_rename = 1; // set number of the artboard you want to change - should be 1 or higher; max = max number of artboards in your document
abIdx = which_artBoard_to_rename - 1;
aDoc.artboards[0].name = aDoc.name.substring(0,aDoc.name.lastIndexOf("."))+"New Name 1"; // set the new name here
aDoc.artboards[1].name = aDoc.name.substring(0,aDoc.name.lastIndexOf("."))+"New Name 2"; // set the new name here
aDoc.artboards[2].name = aDoc.name.substring(0,aDoc.name.lastIndexOf("."))+"New Name 3"; // set the new name here
Find more inspiration, events, and resources on the new Adobe Community
Explore Now