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

Change artboard name to file name

New Here ,
Aug 05, 2022 Aug 05, 2022

I need to stack process 900+ .ai files so that the artboards become renamed after the file itself.

There are a ton of direction if you want to name a file after its artboard but not the way around.

 

Thanks for the effort!

TOPICS
Import and export , Scripting , Sync and storage
755
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
Adobe
Advisor ,
Aug 05, 2022 Aug 05, 2022

hello @UXexplorer,

 

Give the below script a try... just run the script on the folder that contains your files.

 

var main = function() {

var myDirectory = Folder.selectDialog("Select files folder");
var files = myDirectory.getFiles(/.(ai|eps)$/i);

for(var f = 0; f < files.length; f++){
 var doc = app.open(files[f]);
 var myDocName = doc.name;

for(var a = 0; a < doc.artboards.length; a++) {
  doc.artboards.setActiveArtboardIndex(a);
    doc.artboards[a].name = myDocName + "_" + (a+1);  
      artboardName = doc.artboards[a].name.toString();
  }
  app.activeDocument.close(SaveOptions.SAVECHANGES);
 }
 alert("Done renaming Artboards on " + files.length + " files!")
}
main();

 

Regards,

Mike

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
Explorer ,
Feb 20, 2024 Feb 20, 2024

Hi

 

This looks like the script that I need - but where do I run it from? Inside Illustrator? I'm getting an error there (a yellow triangle with exclamation mark, no words)

 

Cheers

 

R

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
Advocate ,
Feb 20, 2024 Feb 20, 2024

Ce script fonctionne.

copiez le texte

puis enregistrez sous le nom de votre choix.js

puis dans Illustrator

<CTRL>+F12

....

 

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
Explorer ,
Feb 21, 2024 Feb 21, 2024

I used Script Editor, compiled as Javascript and ran it from Illustrator > Scripts and all I get is a non-specific error — and the Illustrator Menus stop working too.

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
Advocate ,
Feb 22, 2024 Feb 22, 2024
LATEST

Bonjour Rob,

Il faut copier le texte dans un éditeur de texte et l'enregistrer avec l'extension .js ou .jsx

Ce doit être du texte pure qui sera interprété par Illustrator au lancement du script.

Vous pouvez utiliser ExtendScript Toolkit.exe si ce programme est installé sur votre système.

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