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

Indesign - Rename Style Object by CSV in

Community Beginner ,
Mar 29, 2025 Mar 29, 2025

Hello,

Do you know if there is an Indesign script that can rename 
object styles (taking into account different groups and subgroups) in bulk from a defined list (e.g. a CSV)?

CSV as:
STYLES:GROUP_1:GROUPE_2:GROUPE:3:MY_STYLE  tab  STYLES:GROUP_1:GROUPE_2:GROUPE:3:MY_NEW_STYLE

It's possible?

TOPICS
Scripting
218
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 , Mar 29, 2025 Mar 29, 2025
quote

Yes, I have Excel installed and I know how to use it. I specialize in EasyCatalog automation but script writing is my weak point.

Sorry if my tense seems dry, English is not my language. 🙂 


By RYR9

 

Great.

 

No worries, your English is perfectly fine - for me at least 😉 

 

Instead of a script that will read new names from the CSV file and process them in a loop, bla bla bla 😉 - you can generate script in Excel - and then just run it 🙂 

 

In JS, to rename a style - in a group, one level de

...
Translate
Community Expert ,
Mar 29, 2025 Mar 29, 2025

Yes, it's perfectly doable. 

 

Only the name of the ObjectStyles or groups / folders as well? 

 

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 Beginner ,
Mar 29, 2025 Mar 29, 2025

Just rename the name of objects styles.
Sometimes, the objects styles may have identical names in differents groups.

STYLES:GROUP_1:GROUPE_2:GROUPE_3:MY_STYLE 
→ STYLES:GROUP_1:GROUPE_2:GROUPE_3:MY_NEW_STYLE

STYLES:GROUP_1:GROUPE_1:GROUPE_5:MY_STYLE 
→ STYLES:GROUP_1:GROUPE_1:GROUPE_5:MY_NEW_STYLE

…

 

I need to re-adapt names to use a script (already written) that swaps object styles (horizontal or vertical presentation).

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 ,
Mar 29, 2025 Mar 29, 2025

Can you post script you have? 

 

It could most likely do 2in1.

 

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 Beginner ,
Mar 29, 2025 Mar 29, 2025

I can't autorize to post the second script. 
For me these are different uses.

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 ,
Mar 29, 2025 Mar 29, 2025

OK. 

 

Question - do you have Excel installed and know how to use it?

 

Not trying to be rude - but you could just use it to solve your problem. 

 

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 Beginner ,
Mar 29, 2025 Mar 29, 2025

Yes, I have Excel installed and I know how to use it. I specialize in EasyCatalog automation but script writing is my weak point.

Sorry if my tense seems dry, English is not my language. 🙂 

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 ,
Mar 29, 2025 Mar 29, 2025
quote

Yes, I have Excel installed and I know how to use it. I specialize in EasyCatalog automation but script writing is my weak point.

Sorry if my tense seems dry, English is not my language. 🙂 


By RYR9

 

Great.

 

No worries, your English is perfectly fine - for me at least 😉 

 

Instead of a script that will read new names from the CSV file and process them in a loop, bla bla bla 😉 - you can generate script in Excel - and then just run it 🙂 

 

In JS, to rename a style - in a group, one level deep - you would have to do something like this: 

 

app.activeDocument.objectStyleGroups.item("level1").objectStyles.item("old_name_1") = "new_name_1";

 

For 2x levels: 

 

app.activeDocument.objectStyleGroups.item("level1").objectStyleGroups.item("level2").objectStyles.item("old_name_1") = "new_name_1";

 

I hope you get how 3rd level would look like 😉 

 

So, in Excel, you would've to create a spreadsheet, that will use data from your CSV file - and will build lines like the above - using concatenate().

 

Just remember that your names need to be enclosed in " ". 

 

Then: 

 

https://creativepro.com/how-to-install-scripts-in-indesign/

 

I hope my explanation is clear enough 😉 

 

I just prefer simple solutions 😉 

 

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 ,
Mar 29, 2025 Mar 29, 2025

@RYR9

 

Of course, it should be "object" - not "paragraph" - fixed in the code above, sorry. 

 

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 Beginner ,
Mar 30, 2025 Mar 30, 2025

I just did some initial tests and it works. In any case, it will be very useful for my work; and make it efficient.
Thanks so much, Robert.

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 ,
Mar 30, 2025 Mar 30, 2025
LATEST

You're welcome 🙂 

 

You can use the same technique for other Styles. 

 

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