Skip to main content
Participant
October 11, 2021
Question

Automatically rename current artboard to the name of the topmost visible object.

  • October 11, 2021
  • 2 replies
  • 680 views

I don't know anything about scripting.  I wanted to know if it were possible to make a script that will rename the artboard that is currently selected to the name of the topmost visible object. I have a 100+ glyphs to export and needed to be renamed its character. Now, what I've done is I have those 100+ glyphs stacked at the top each other and the way I'm gonna export those glyphs is by hiding the unneeded glyphs and only showing the glyph needed to export. I also can't use multiple artboard because the required artboard size of fontforge is 1000px by 1000px and the file will be too large if I make multiple artboard for each glyph.

 

This is the image of the glyph I want to export (That's my handwritting).

 

This is the image of the stacked glyphs.

 

This topic has been closed for replies.

2 replies

Sergey Osokin
Inspiring
October 14, 2021

Try this script RenameArtboardAsTopObj. I created it for similar tasks.

j.khakase
Inspiring
August 28, 2024

This is one of the best script to rename the artobards and I am really so thankfull for it to @Sergey Osokin .

with this post I am requesting it will be great if we can able to entered the specific range of artboards or comma seperated value as well.

 

UI something like this below:

 

femkeblanco
Legend
October 11, 2021

There are few unknowns, but this is a basic idea.  See if it works for you. 

 

app.executeMenuCommand("selectall");
var items = app.activeDocument.selection;
for (var i = 0; i < items.length; i++) {
    if (items[i].hidden == false) {
        app.activeDocument.artboards[0].name = items[i].name;
        break;
    }
}