Skip to main content
Chris  G
Inspiring
April 17, 2019
Answered

Automatically rename current artboard to something else.

  • April 17, 2019
  • 1 reply
  • 4118 views

I don't know anything about scripting.  I wanted to know if it were possible to make a script that will rename the artboard that is currently selected to a different name.

For example.  I have a document that has 4 artboards on it.   All 4 of the artboards already have current names, (Proof, Artwork, etc.).  I need to add a new artboard to the existing document.  The new artboard has "Artboard 5" as the name.  I need to change that to "Job Jacket".  However, I need to do this for thousands of files, so I need a streamlined way to do it rather than clicking and typing through the artboards panel.

Other notes; some of the existing documents will have less existing artboards, and some will have more artboards.  This is why I ask if there is a way to only rename the currently selected artboard.

Is this possible?

This topic has been closed for replies.
Correct answer pixxxelschubser

Try that

// set a new name eg "Job Jacket" for the active artboard in active document

var aDoc = app.activeDocument;

var abIdx = aDoc.artboards.getActiveArtboardIndex ();

aDoc.artboards[abIdx].name = "Job Jacket"; // set the new name here

Have fun

1 reply

pixxxelschubser
pixxxelschubserCorrect answer
Adobe Expert
April 17, 2019

Try that

// set a new name eg "Job Jacket" for the active artboard in active document

var aDoc = app.activeDocument;

var abIdx = aDoc.artboards.getActiveArtboardIndex ();

aDoc.artboards[abIdx].name = "Job Jacket"; // set the new name here

Have fun

Stephen Marsh
Adobe Expert
April 17, 2019

Adding to pixxxel schubsers great example: If a simple interactive method is required:

// https://forums.adobe.com/message/11034337#11034337

// set a new name eg "Job Jacket" for the active artboard in active document via prompt

var aDoc = app.activeDocument; 

var abIdx = aDoc.artboards.getActiveArtboardIndex (); 

var abName = prompt("Rename Active Artboard" + "\n" + "Enter a new name:", "Job Jacket");

aDoc.artboards[abIdx].name = abName;

Prepression: Downloading and Installing Adobe Scripts

Chris  G
Chris GAuthor
Inspiring
April 18, 2019

Stephen_A_Marsh  wrote

Adding to https://forums.adobe.com/people/pixxxel+schubser great example: If a simple interactive method is required:

// https://forums.adobe.com/message/11034337#11034337 // set a new name eg "Job Jacket" for the active artboard in active document via prompt var aDoc = app.activeDocument;   var abIdx = aDoc.artboards.getActiveArtboardIndex ();   var abName = prompt("Rename Active Artboard" + "\n" + "Enter a new name:", "Job Jacket"); aDoc.artboards[abIdx].name = abName;

Prepression: Downloading and Installing Adobe Scripts

This is really cool and might come in handy.  For this specific task, I wanted to make the process as quick as possible.  Thanks for the script though.  It might help someone else looking for something similar too!