[ Branched ] Illustrator Script to Rename Artboards based on Artboard Size

New Here ,
Jan 29, 2021

Copy link to clipboard

Copied

Hello @pixxxelschubser 

Thank you for this script. In combination with the point to MM change you made, I managed to make this in CM.
Perfect!!

 

But, I have to work with large number of artboards. You mentioned to create a loop for all the artboard.
I really have no idea how to do that. Can you help me with that?

Illustrator Script to Rename Artboards based on Artboard Size



 

[ branched from Illustrator Script to Rename Artboards based on Artboard Size to Illustrator forum by moderator ]

 

TOPICS
Scripting

Views

51

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

1 Correct Answer

Most Valuable Participant , Jan 29, 2021
pixxxelschubser Most Valuable Participant , Jan 29, 2021
Hi @matthijsd65499803  there was a loop in the other thread (in this answer Illustrator Script to Rename Artboards based on Artboard Size #2 ). But the code was destroyed two years ago by switching to the new forum software.   Try this corrected version:   var aDoc = app.activeDocument; for (i=0; i<aDoc.artboards.length; i++) { var AB = aDoc.artboards[i]; var ABR = AB.artboardRect; AB.name = ((ABR[2] - ABR[0])*0.3527778).toFixed(1) + " mm × " + ((ABR[1] - ABR[3])*0.3527778).toFixed...

Likes

Translate

Translate
Jump to answer Jump to answer
Most Valuable Participant ,
Jan 29, 2021

Copy link to clipboard

Copied

Hi @matthijsd65499803 

there was a loop in the other thread (in this answer Illustrator Script to Rename Artboards based on Artboard Size #2 ). But the code was destroyed two years ago by switching to the new forum software.

 

Try this corrected version:

 

var aDoc = app.activeDocument;

for (i=0; i<aDoc.artboards.length; i++) {
    var AB = aDoc.artboards[i];
    var ABR = AB.artboardRect;
    AB.name = ((ABR[2] - ABR[0])*0.3527778).toFixed(1) + " mm  × " + ((ABR[1] - ABR[3])*0.3527778).toFixed (1) + " mm";
}

 

 

 

If that works for you

have fun

😉

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more