Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

How to reapply styles to get rid of local formating automatically?

Return to Member Forum

  • Author
    Posts
    • #58562
      hancilt
      Member

      Hi, I wonder if there is an easy way to tell IND (CS5) to reapply all styles and override local formating. I have my document imported from MSWord with styles matching, so all my styles are applied – yet the local formating from MSW is still there. (and setting character styles to none does not do the trick).

      All the features I need – such as italics, special fonts, such as syriac etc. are captured by character styles.

      All I need now is to tell IND to reapply all paragraph styles again as if clicked with ALT – override local formating.

      Is there a way to do it?

      Couple of years ago I got this

      from Peter Kahrel which reapplies fottnote style to all footnotes – which is very helpful indeed.

      app.documents[0].stories.everyItem().footnotes.everyItem().paragraphs.everyItem().appliedParagraphStyle
      = “your footnote style here”

      Now I am wondering if somebody has a more general version to do that for all applied styles in the whole document.

      Thanks Tomas

    • #58563

      Try this, for the main text:

      app.activeDocument.stories.everyItem().paragraphs.everyItem().clearOverrides(OverrideType.ALL);

      I think it doesn't work for text in tables and/or footnotes, because these are part of some other internal model.

    • #58564
      hancilt
      Member

      Thank you – it does the trick – very efficient – it cleans even items on master pages.

      I really appreaciate your imput to this forum. (I have learned a lot from your grep examples over the years here, but being only occasional user of IND I will probably not start seriously learning scripting – GREP does a lot for me)

      Thus even if it looks trivial – it would take me a long time to come up with a similar one-liner to solve my problem. Thanks

    • #58566
      David Blatner
      Keymaster

      That looks great (especially if you had lots of stories), but don't forget that there is already a feature in InDesign designed to do this for an imported story: The Clear All Overrides button at the bottom of the Paragraph Styles panel. Just select all the text and click it.

      If you need more fine-tuned control over what formatting is saved and what is removed, you might consider looking at the Remove Local Overrides feature in the Blatner Tools suite (blatnertools.com)

Viewing 3 reply threads
  • You must be logged in to reply to this topic.
Forum Ads