How to change language in all paragraph styles all at once?
Copy link to clipboard
Copied
I have a book in English that all paragraph and charachter styles are already set, now I need to make a copy of english styles and change all at once to Spanish, is there any easy way in Indesign to change all at once without clicking on each paragraph style and change to spanish one by one?
Remmeber I don't make style from scratch, only changing previous styles.
I use Indesign CS6
Has Adobe any script for that?
Copy link to clipboard
Copied
If all styles are children of a single parent styl, as it should be, change the language of that style.
Copy link to clipboard
Copied
I respectfully disagree with 'As it should be'. Absolutely not, that would be a nightmare.
Copy link to clipboard
Copied
I agree (mostly) with Willi.
All my Body-based styles are children of the Body parent.
All my heading styles are children of the main head (e.g., Heading1) but are NOT connected to Body.
My Table styles are based off of one another but NOT connected to Body.
etc.
In other words, they are based-on in logical groups, so depending on the complexity of the document, I might have 4-6 main styles to edit to change the language.
Copy link to clipboard
Copied
And then there are Accessibility tags and you change a level. You have to check each 'based upon' style. I respectfully disagree with 'as it should be'. You can, not should.
Copy link to clipboard
Copied
for (var a = app.activeDocument.paragraphStyles.length - 1; a > 1; a--)
{
app.activeDocument.paragraphStyles[a].appliedLanguage = "Polish";
}
https://creativepro.com/how-to-install-scripts-in-indesign/
You could change "a > 1;" to "a > 0;"- but this will also change the definition of "[Basic Paragraph]" Style.
The other option would be to export IDML file and edit it directly.
Copy link to clipboard
Copied
Changing language for [Basic Paragraph] would probably be appropriate in this case, especially if any other style is based on it. And as I read the question, the OP wants to change the language to Spanish rather than Polish so that would be another change the should make in your code.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
But this will change the paragraph styles which are at document level (meaning styles not under an folder - style group).
What if OP has created or using styles which are under style group?
Copy link to clipboard
Copied
for (var a = app.activeDocument.allParagraphStyles.length - 1; a > 1; a--)
{
app.activeDocument.allParagraphStyles[a].appliedLanguage = "Polish";
}
Copy link to clipboard
Copied
Hi @dtp_1544 ,
just a remark on the value that you need for property appliedLanguage in Robert's script:
Best use a representation that will work in every localisation of InDesign, not only in the English one.
With Spanish in mind you can test this string:
"$ID/Spanish"
So with Robert's code it would be:
for (var a = app.activeDocument.allParagraphStyles.length - 1; a > 1; a--)
{
app.activeDocument.allParagraphStyles[a].appliedLanguage = "$ID/Spanish";
}
Just tested this with my German InDesign 2025.
Regards,
Uwe Laubender
( Adobe Community Expert )
Copy link to clipboard
Copied
Just another remark on the strings used with appliedLanguage:
"Polish" or "Spanish" for example will not work with my German InDesign.
Regards,
Uwe Laubender
( Adobe Community Expert )

