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

Mass renaming identically-styled objects

Explorer ,
Jan 26, 2024 Jan 26, 2024

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

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

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

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

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 ,
Jan 26, 2024 Jan 26, 2024
Most are variants on this:
 
var docRef = app.activeDocument;  

var sel = docRef.selection;  

for (var i=0; i < sel.length; i++)  
     sel.name = "NewName";
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 Expert ,
Jan 26, 2024 Jan 26, 2024

this works

var docRef = app.activeDocument;  

var sel = docRef.selection;  

for (var i=0; i < sel.length; i++)  
     sel[i].name = "NewName";
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 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

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

Yes, that worked well, thank-you.

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