Copy link to clipboard
Copied
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?
1 Correct answer
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
...Copy link to clipboard
Copied
Yes, it's perfectly doable.
Only the name of the ObjectStyles or groups / folders as well?
Copy link to clipboard
Copied
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).
Copy link to clipboard
Copied
Can you post script you have?
It could most likely do 2in1.
Copy link to clipboard
Copied
I can't autorize to post the second script.
For me these are different uses.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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. 🙂
Copy link to clipboard
Copied
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 😉
Copy link to clipboard
Copied
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
You're welcome 🙂
You can use the same technique for other Styles.

