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

Mass renaming identically-styled objects

Explorer ,
Jan 26, 2024 Jan 26, 2024

Copy link to clipboard

Copied

I need to rename every yellow rectangle in my project to have the same name.

 

Selecting them is easy, however I cannot find a way to rename them all to be the same thing, and the scripts online simply run without apparently doing anything (has the script API changed or something??)

 

Thanks in advance to those sparing their time to suggest approaches.
(there are a lot of yellow rectangles!)

 

TOPICS
How-to , Scripting , Tools

Views

169

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 , Jan 26, 2024 Jan 26, 2024

Sergey Osokin has a nice script to rename selected objects (Rename Items).

 

It comes with a modal dialog which is pretty useful if you want to rename items often.

 

Rename Items by Sergey Osokin

Votes

Translate

Translate
Adobe
Community Expert ,
Jan 26, 2024 Jan 26, 2024

Copy link to clipboard

Copied

Can you share a script that doesn't work as you expect?

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 ,
Jan 26, 2024 Jan 26, 2024

Copy link to clipboard

Copied

Most are variants on this:
 
var docRef = app.activeDocument;  

var sel = docRef.selection;  

for (var i=0; i < sel.length; i++)  
     sel.name = "NewName";

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 ,
Jan 26, 2024 Jan 26, 2024

Copy link to clipboard

Copied

this works

var docRef = app.activeDocument;  

var sel = docRef.selection;  

for (var i=0; i < sel.length; i++)  
     sel[i].name = "NewName";

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 ,
Jan 26, 2024 Jan 26, 2024

Copy link to clipboard

Copied

Sergey Osokin has a nice script to rename selected objects (Rename Items).

 

It comes with a modal dialog which is pretty useful if you want to rename items often.

 

Rename Items by Sergey Osokin

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 ,
Jan 29, 2024 Jan 29, 2024

Copy link to clipboard

Copied

LATEST

Yes, that worked well, thank-you.

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