Copy link to clipboard
Copied
I have updated certain styles in template now I need to updated those styles in source indd file.
Do we have any way to map the styles or do we can replace the styles from one indd doc to another is there possible.
Otherwise do we have any other simplest way in indesign.
I have to replace more than 30 to 40 documents.
Then it take so long time.
Is there any script to make it soon.
Copy link to clipboard
Copied
That is very handy, use this code
var theDocument = app.activeDocument;
//Choose Source file (from which you want to import styles).
var sourceFile = File.openDialog ("choose file", false);
//import paragraph styles
var paraImport = ImportFormat.PARAGRAPH_STYLES_FORMAT;
//This will import without overwrite existing styles.
var clashPolicy = GlobalClashResolutionStrategy.DO_NOT_LOAD_THE_STYLE;
theDocument.importStyles(paraImport, sourceFile, clashPolicy);
Mac
Copy link to clipboard
Copied
Thanks
It works now I can add the new style from one doc to another without overwriting. But what I need is how to replace the sytle name from one doc to another.
Acutally I have 10 indd files in that i need to change the style name according to the publishing standard but these indd doc already some guys did as they wish that makes me a big probs.
Kindly give a solution in this matter.
Copy link to clipboard
Copied
Try to find out this in OMV which is with ESTK.
//Change respective line to next line.
var clashPolicy = GlobalClashResolutionStrategy.DO_NOT_LOAD_THE_STYLE;
var clashPolicy = GlobalClashResolutionStrategy.LOAD_ALL_WITH_OVERWRITE;
Mac
Copy link to clipboard
Copied
The actual probs is I need to replace only the style naming not the style.
Example:
In indd file the style name is "Title" I need to replace this style name to Chapter Title.
Is this Possible in
scripting?
Copy link to clipboard
Copied
REMO1980 wrote:
The actual probs is I need to replace only the style naming not the style.
Example:
In indd file the style name is "Title" I need to replace this style name to Chapter Title.
Is this Possible in
scripting?
Yes its possible ....
Check below code
//rename paragraph style
var myDoc = app.activeDocument;
if (myDoc.paragraphStyles.item("Title") != null)
{
myDoc.paragraphStyles.item("Title").name = "Chapter Title";
}
But if you importing template style and your template style naming is different then your document stye. I think you can also use delete old style and replace with your new style.
//delete and replace paragraph style
if (myDoc.paragraphStyles.item("Title") != null && myDoc.paragraphStyles.item("Chapter Title") != null)
{
myDoc.paragraphStyles.item("Title").remove("Chapter Title");
}
Shonky
Copy link to clipboard
Copied
Thanks. Really it works.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now