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

Add Ref. No at starting of the custom artboard name

Engaged ,
Jul 31, 2022 Jul 31, 2022

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

 

Add Artboard Ref. No at starting of the custom artboard name.png

TOPICS
Scripting
1.3K
Translate
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

Enthusiast , Jul 31, 2022 Jul 31, 2022

Maybe you will find this script useful. It has a lot more options https://github.com/creold/illustrator-scripts/blob/master/jsx/BatchRenamer.jsx
batch-renamer.gif

Translate
Adobe
Enthusiast ,
Jul 31, 2022 Jul 31, 2022

Maybe you will find this script useful. It has a lot more options https://github.com/creold/illustrator-scripts/blob/master/jsx/BatchRenamer.jsx
batch-renamer.gif

Translate
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
Engaged ,
Jul 31, 2022 Jul 31, 2022

Wow, Great, absolutely working

Sergey Osokin, you given me lot lot than I was expecting.

Thank you so much 🙂

Translate
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
Engaged ,
Aug 02, 2022 Aug 02, 2022

Hello Sergey Osokin,

How to define color for Numbers as you shown in animation?

Translate
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
Enthusiast ,
Aug 02, 2022 Aug 02, 2022

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();
}

 

Translate
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
Enthusiast ,
Aug 03, 2022 Aug 03, 2022

Uploaded a new version to Github, where you can set the index color in "CFG.idxColor: [255, 0, 0]"

Translate
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
Engaged ,
Aug 03, 2022 Aug 03, 2022

Thank You so much, this will save time to review pages while renaming the artboards at complex artwork

Translate
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 ,
Sep 06, 2022 Sep 06, 2022

How can this be run in Adobe Illustrator? I'm new to using scripts.

Translate
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 ,
Sep 06, 2022 Sep 06, 2022

Disregard! I found the installation instructions. Apologies for asking too quick

Translate
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
Participant ,
Apr 19, 2023 Apr 19, 2023

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...



Translate
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
Enthusiast ,
Apr 19, 2023 Apr 19, 2023
Can you record a gif, mp4 example? Which version of the script are you using? You can send information in messages in my profile.
Translate
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
Participant ,
Apr 20, 2023 Apr 20, 2023
LATEST

Hi Sergey, I wrote you a message from your profile, however I discovered how to use it without errors, thanks again!

Translate
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
LEGEND ,
Aug 01, 2022 Aug 01, 2022

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();
Translate
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
Engaged ,
Aug 02, 2022 Aug 02, 2022

Yes, Its working as expect. Thank you so much. 

Translate
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
Engaged ,
Aug 02, 2022 Aug 02, 2022

It will be great, if this script works only at selected artboards in the panel, is it possible ?

Translate
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
Enthusiast ,
Aug 02, 2022 Aug 02, 2022

No. Selected layers and artboards in panels are used by the user for manual movement, but this selection is not available to the API.

Translate
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
Engaged ,
Aug 03, 2022 Aug 03, 2022

Its OK, but you solved my Big problem of Renaming Artboards 

Translate
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