0

Is there a way to batch rename a bunch of selected artboards in illustrator?

any script or plug-in appreciated...

Partly Answer:

Edited code of @GoodJobStudios; In this edit, the Variable counter of Artboards and increment number are different. It causes the script to numbering the range you want from 1, and not numbering by artboard index number.

  function artBoardName_serial() {
    var doc = app.activeDocument;  
var start=(0)-1;
    for (var i = start, l = doc.artboards.length; i < l; i++) {  
        if (doc.artboards[i].active) {
                }
                // THIS IS WHERE THE RENAMING HAPPENS
                doc.artboards[i].name = "agha"+((i-start)+1);  
            }    
    }

function renameArtBoard_MAIN() {
    if (app.documents.length == 0) {  
alert("No Open / Active Document Found");  
    } else {  
        artBoardName_serial();
    }  
}

renameArtBoard_MAIN();
0
5

This works (save as .jsx in your script folder)

      function artBoardName_serial() {
        var doc = app.activeDocument;  
        for (var i = 0, l = doc.artboards.length; i < l; i++) {  
            if (doc.artboards[i].active) {
                    }
                    // THIS IS WHERE THE RENAMING HAPPENS
                    doc.artboards[i].name = "a"+(i+1);  
                }    
        }

    function renameArtBoard_MAIN() {
        if (app.documents.length == 0) {  
    alert("No Open / Active Document Found");  
        } else {  
            artBoardName_serial();
        }  
    }

    renameArtBoard_MAIN();
2
  • Great... Very handy. I have a wish list of artboards naming. Just to know : 1. Adding ability to keep current name. 2. Adding a prefix. 3. Adding a suffix 4. Changes applied to a range of artboards. 5. More numbering options like adding tab zeros and set a starting number manually. all of these comes so more cool with a good UI. :D... btw thanks for this.
    – Roozbeh E
    Dec 10 '18 at 11:30
  • Simple. No complicated configurations. Easy to change what its renaming. Jun 25 '20 at 14:18
2

Building on GoodJobStudios's code from the accepted answer, this script will give the user find-and-replace prompts. Save as .jsx, open your Illustrator file, and run script from File -> Scripts -> Other Scripts -> Find and select the saved .jsx file.

Alternatively, if on MacOS, save the file to your Illustrator script presets [HDNAME]/Applications/Adobe Illustrator 2021/Presets.localized/en_US/Scripts/ to keep the file easily accessible until a new version of Illustrator is released.

  function artBoardName_serial() {
    var doc = app.activeDocument,
        searchtext = prompt("Artboard name substring to find:", ""),
        replacetext = prompt("Replace found text with:", "");
    if (searchtext == undefined || searchtext === "") {
      alert("Text to find cannot be blank.");
    } else {
      for (var i = 0, l = doc.artboards.length; i < l; i++) {
        doc.artboards[i].name = doc.artboards[i].name.replace(searchtext,replacetext);
      }
    }
  }

  function renameArtBoard_MAIN() {
    if (app.documents.length == 0) {
      alert("No Open / Active Document Found");
    } else {
      artBoardName_serial();
    }
  }
  renameArtBoard_MAIN();
1
  • Good script, it can save a lot of time!
    – Roozbeh E
    Apr 17 at 12:16
1

It is not currently possible to script this because its not possible to know which artboards are selected. There is no such hook in the scripting api*. But its possible to change name just not based on selection.

It is possible that the plugin API has these functions, but given that only newest version o illustrator CC can even inteligently do this I doubut its well documented. Atleast in the current SDK there seems to be no mention of this. So given that thi sis the case and if we add the extra overhead of plugin development its not worth the time involved.

* This is what happens when the API is not a core design feature of your application, one can not really add a API it must be the first thing that is done every time something gets done.

6
  • So how Illustrator understands which ones have to be deleted! because multiselect and delete is available.
    – Roozbeh E
    May 29 '18 at 11:16
  • @RoozbehE Illustrator may know a lot of things but if they dont expose it with the API theres nothing we can do.
    – joojaa
    May 29 '18 at 11:18
  • So... I thought may this give some people a clue here about issue ... I Returned to my thread 'cause I just needed the subject again. Found some PDF documents about artboard and artboards objects in jse. For sure you developers knew it before, but maybe comments here pop somethin in who ever's head they read this! Who knows!
    – Roozbeh E
    May 29 '18 at 20:15
  • @RoozbehE But i can still batch rename them just not get the selection
    – joojaa
    May 30 '18 at 12:36
  • really? you mean it's possible to batch rename all artboards... and put increment to it too... even this could be good for me!
    – Roozbeh E
    May 30 '18 at 13:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.