• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Illustrator Script to Rename Artboards based on Artboard Size

Explorer ,
Aug 29, 2014 Aug 29, 2014

Copy link to clipboard

Copied

Hi there,

I was wondering if anyone has a script they'd like to share which would rename all artboards in a document with their size?

Thanks


Eric

TOPICS
Scripting

Views

2.1K

Translate

Translate

Report

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

correct answers 1 Correct answer

Community Expert , Aug 29, 2014 Aug 29, 2014

Hi ericsoup,

This works for your artboard[0]

var AB = app.activeDocument.artboards[0];

var ABR = AB.artboardRect;

AB.name = (ABR[2] - ABR[0]).toFixed(3) + " points  × " + (ABR[1] - ABR[3]).toFixed (3) + " points";

All you have to do is to add a loop through your artboards.

Have fun

Votes

Translate

Translate
Adobe
Community Expert ,
Aug 29, 2014 Aug 29, 2014

Copy link to clipboard

Copied

Hi ericsoup,

This works for your artboard[0]

var AB = app.activeDocument.artboards[0];

var ABR = AB.artboardRect;

AB.name = (ABR[2] - ABR[0]).toFixed(3) + " points  × " + (ABR[1] - ABR[3]).toFixed (3) + " points";

All you have to do is to add a loop through your artboards.

Have fun

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 11, 2018 Apr 11, 2018

Copy link to clipboard

Copied

Hi

https://forums.adobe.com/people/pixxxel+schubser  schrieb

Hi ericsoup ,

… All you have to do is to add a loop through your artboards.

Have fun

… and a little change for getting mm instead of points:

var aDoc = app.activeDocument;

for (i=0; i<aDoc.artboards.length; i++) {

    var AB = aDoc.artboards

    var ABR = AB.artboardRect; 

    AB.name = ((ABR[2] - ABR[0])*0.3527778).toFixed(1) + " mm  × " + ((ABR[1] - ABR[3])*0.3527778).toFixed (1) + " mm";

}

Have fun

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 11, 2018 Apr 11, 2018

Copy link to clipboard

Copied

Very very very thx, i love you man. 😃

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 03, 2014 Dec 03, 2014

Copy link to clipboard

Copied

A much delayed thank you.  This worked great. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 03, 2014 Dec 03, 2014

Copy link to clipboard

Copied

Better late than never …

You're welcome.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 11, 2018 Apr 11, 2018

Copy link to clipboard

Copied

Anybody knows, how to do it with mm? And to all art bords?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 26, 2022 Oct 26, 2022

Copy link to clipboard

Copied

Hello! Does anyone know if this will work for Photoshop? Many thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 26, 2022 Oct 26, 2022

Copy link to clipboard

Copied

LATEST

most likely it won't work in Photoshop

Votes

Translate

Translate

Report

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