Skip to main content
Known Participant
April 5, 2018
Answered

How to load default styles automatically in legacy documents.

  • April 5, 2018
  • 2 replies
  • 1307 views

I've created a bunch of character, paragraph, and object styles with no document open so that they'll be used in any new document. Is there any way to also automatically include these styles in documents that were created earlier? Right now I just manually load styles from a more recent document.

Thanks in advance!

This topic has been closed for replies.
Correct answer winterm

Seamlessly and 'automagically' - no, you can't.

However, you can use script for this. Just one click, not so bad

app.activeDocument.importStyles(ImportFormat.CHARACTER_STYLES_FORMAT, File("D:/Samples/MasterStyles.indt"), GlobalClashResolutionStrategy.LOAD_ALL_WITH_OVERWRITE);

app.activeDocument.importStyles(ImportFormat.PARAGRAPH_STYLES_FORMAT, File("D:/Samples/MasterStyles.indt"), GlobalClashResolutionStrategy.LOAD_ALL_WITH_OVERWRITE);

app.activeDocument.importStyles(ImportFormat.CELL_STYLES_FORMAT, File("D:/Samples/MasterStyles.indt"), GlobalClashResolutionStrategy.LOAD_ALL_WITH_OVERWRITE);

app.activeDocument.importStyles(ImportFormat.TABLE_STYLES_FORMAT, File("D:/Samples/MasterStyles.indt"), GlobalClashResolutionStrategy.LOAD_ALL_WITH_OVERWRITE);

app.activeDocument.importStyles(ImportFormat.TABLE_AND_CELL_STYLES_FORMAT, File("D:/Samples/MasterStyles.indt"), GlobalClashResolutionStrategy.LOAD_ALL_WITH_OVERWRITE);

app.activeDocument.importStyles(ImportFormat.OBJECT_STYLES_FORMAT, File("D:/Samples/MasterStyles.indt"), GlobalClashResolutionStrategy.LOAD_ALL_WITH_OVERWRITE);

       

alert("All Styles from Master loaded");

Just remember to change the path to source to your own (mine is D:/Samples/MasterStyles.indt)

upd:

Hi, Barb, right after You...

2 replies

winterm
wintermCorrect answer
Legend
April 5, 2018

Seamlessly and 'automagically' - no, you can't.

However, you can use script for this. Just one click, not so bad

app.activeDocument.importStyles(ImportFormat.CHARACTER_STYLES_FORMAT, File("D:/Samples/MasterStyles.indt"), GlobalClashResolutionStrategy.LOAD_ALL_WITH_OVERWRITE);

app.activeDocument.importStyles(ImportFormat.PARAGRAPH_STYLES_FORMAT, File("D:/Samples/MasterStyles.indt"), GlobalClashResolutionStrategy.LOAD_ALL_WITH_OVERWRITE);

app.activeDocument.importStyles(ImportFormat.CELL_STYLES_FORMAT, File("D:/Samples/MasterStyles.indt"), GlobalClashResolutionStrategy.LOAD_ALL_WITH_OVERWRITE);

app.activeDocument.importStyles(ImportFormat.TABLE_STYLES_FORMAT, File("D:/Samples/MasterStyles.indt"), GlobalClashResolutionStrategy.LOAD_ALL_WITH_OVERWRITE);

app.activeDocument.importStyles(ImportFormat.TABLE_AND_CELL_STYLES_FORMAT, File("D:/Samples/MasterStyles.indt"), GlobalClashResolutionStrategy.LOAD_ALL_WITH_OVERWRITE);

app.activeDocument.importStyles(ImportFormat.OBJECT_STYLES_FORMAT, File("D:/Samples/MasterStyles.indt"), GlobalClashResolutionStrategy.LOAD_ALL_WITH_OVERWRITE);

       

alert("All Styles from Master loaded");

Just remember to change the path to source to your own (mine is D:/Samples/MasterStyles.indt)

upd:

Hi, Barb, right after You...

Barb Binder
Community Expert
Community Expert
April 5, 2018

And sometimes, the InDesign Scripting forum comes to you!

~Barb

~Barb at Rocky Mountain Training
BobLevine
Community Expert
Community Expert
April 5, 2018

If you want to do this on a case by case basis, you can create a new document with those styles in it. Open any document you want to change and select load styles from either the paragraph of character styles panel and browse to the file containing the styles.

Follow the prompts and make the appropriate choices.

Barb Binder
Community Expert
Community Expert
April 5, 2018

Hi Dan:

That's how system defaults work—they impact all new documents, but don't go back and change the old ones. Maybe there's a scripting option—and you can ask here: InDesign Scripting—but staying within the InDesign feature set, you'll have to load them into each legacy file.

Now some ideas to soften the blow:

  1. You could make a temporary book file, add all the legacy files and sync the paragraph, character styles and object styles, and then delete the book,
  2. You could put the new styles in a CC library and then add them to the legacy files as you open them to edit, or
  3. You can add the styles to an InDesign snippet and drag the snippet into the legacy files as you open then to edit—they bring along the styles—and then delete the snippet.

~Barb

~Barb at Rocky Mountain Training