March 23 2008 • 3:18 PM

Remove All Local Formatting Globally

Klaus (yes, that Klaus, a frequent commenter here) wrote us:

How can I clear all Overrides globally, throughout a whole document, for all ParaStyles — and not just on an individual spread basis?

You can do this, albeit somewhat tediously, by taking advantage of what most people consider to be a bug in InDesign:

  1. With the layout active, open the Find/Change dialog box from the Edit menu. If you’re using CS3 make sure that you’re in the Text section, the first one.
  2. Leave the Find What and Change To fields empty, but underneath them in the Search: dropdwon menu, set the scope of your find/change to Document.
  3. Open the Find Format and Change Format area by clicking the More Options button.
  4. Set both Find Format and Change Format to the same Paragraph style. After clicking the OK button in these dialog boxes, your Find/Change Format area should look like this:fcformat.gif
  5. Now click the Change All button. Clicking the Find button won’t invoke the “bug” — it has to be the Change All button.

Voila, any local text formatting is stripped out of paragraphs using the style you selected, throughout the entire document. Character styles remain intact.

(This is the bug; that local formatting is stripped out. If you ever need to do a Find/Change that includes the same paragraph style in both Format areas but you don’t want to lose local formatting, use only the Find, Change or Change/Find buttons. Stay away from Change All.)

The Find/Change dialog box is still open, so just click the Find Format edit button to switch to the next paragraph style on your list, do the same to Change Format, and click the Change All button. Done. Continue with the other styles as necessary.

Klaus reported back that “It worked, splendidly!”

By the way, well-known InDesign scripter Dave Saunders wrote a free Javascript a few years ago that does the same thing to all the paragraph styles at once, called ReassertParaStyles.js. I tested it with CS3 — changed the extension to .jsx and put it in my Version 4.0 Scripts folder just in case — and it still works.

Go to the Downloads page on Dave’s site, PDS Associates, and look for the link to ReassertParaStyles.js. There are a few other good ones there, too. Don’t forget to send a little monetary encouragement his way if this or any of his other free and useful scripts have helped you out!

13 Responses discussing this post. Add yours below.

  1. March 23rd, 2008 • 3:51 pm • Link

    Thanks, Anne-Marie. To quote myself “It worked, splendidly!” :-)

    However, on trying Dave’s intriguing JS script, I only get this error:

    —————————
    Adobe InDesign
    —————————
    JavaScript Error!

    Error Number: 55
    Error String: Object does not support the property or method ‘findPreferences’
    Line: 4
    Source: app.findPreferences = null;
    —————————
    OK
    —————————

    Not OK, actually. :-(

  2. March 23rd, 2008 • 4:42 pm • Link

    First keep in mind that the scripts on that page are for CS1/CS2 and as it says at the top, they’re “informal” scripts … not heavily debugged for every situation. So YMMV.

    But that said, I cannot duplicate your error. I though maybe it was because you can’t leave Find/Change set up for anything before running the script, but that doesn’t make a diff. it seems. It works for me whether or not a frame is left selected. Hmmm.

    Did you change the extension to “.jsx” and put it in a Version 4.0 Scripts folder as described?

  3. March 23rd, 2008 • 4:56 pm • Link

    The error that Klaus reports would be caused by not using the Version 4.0 Scripts folder (although, that name might work only on English systems; I’m not sure).

    I’ll add making a CS3 version of that script to my list of to-dos.

    Dave

  4. March 23rd, 2008 • 6:11 pm • Link

    “.jsx” — sure.

    As for “Version 4.0 Scripts folder” — I don’t know what that means. I always use this path for all scripts, has always worked fine so far:
    \\Adobe InDesign CS3\Scripts\Scripts Panel\Samples\

  5. March 23rd, 2008 • 10:23 pm • Link

    Putting CS1/CS2 scripts in a folder you create called “Version 4.0 Scripts” folder usually allows CS3 to run them correctly. I think it might even be in the documentation.

    Create the folder yourself in the Finder/Explorer and locate it so the path is this:
    \\Adobe InDesign CS3\Scripts\Scripts Panel\Version 4.0 Scripts\

  6. March 23rd, 2008 • 11:21 pm • Link

    The new folder “Version 4.0 Scripts” did the trick — so thanks, Anne-Marie and Dave!

    Running the script on an important file, I discovered that some text elements did not have any Style applied, but only local formatting — as they reverted back to my deliberately in-your-face green Courier Bold 14pt default font (instead of the insidious black TNR which is ID’s native default and which I loathe). So this gave rise to a script idea: “Find All UnStyled Stuff”. So, Dave, if you have any spare time, you know what to do. :-)

  7. March 28th, 2008 • 12:48 am • Link

    Actually, in CS2 and CS3, there is a simple one-liner script that will do this WAY FASTER! (Especially if there’s a lot of styles…)

    app.documents[0].stories.everyItem().clearOverrides()

  8. March 30th, 2008 • 2:15 pm • Link

    Oy, Herb, thanks! It’s way faster indeed. And to think that such magic can be done with only one line of code.

  9. [Jongware]
    April 8th, 2008 • 10:21 am • Link

    The one thing this one-liner misses is footnotes …

  10. trish
    July 20th, 2008 • 8:35 pm • Link

    this is the first time i’ve seen someone used “YMMV”… interesting!

  11. ashwani
    February 10th, 2011 • 5:04 am • Link

    It works !!! Thanks, you saved my time.

  12. Anne Bursey
    July 18th, 2011 • 1:42 am • Link

    I’m becoming increasingly frustrated. My document (A5 Diary) consists of a separate table for each day. I would like to change the colour of alternate rows on ALL the tables throughout the document at ONCE….not selecting each table and making the change. I’ll have to do this 365 times!!! Surely there is a way as in Word to accomplish this very simple task? Can’t find it on Find/Replace. Find “on table”, “Fill”, put in the find value and change the replace value!

  13. July 18th, 2011 • 5:13 am • Link

    Tables are a different beast.

    If you created them based on a table style, you could edit the style to reflect the new color.

    But honestly I think the easiest solution is to 1) Create the new color you want to use; 2) In the Swatches panel, delete the color the tables are currently using (select it and click the trashcan button); 3) At the prompt, choose the new color to replace the old one you’re deleting.

    This won’t work if you’ve used that color for other things in your publication (text color, borders, fills) because all those will change to the new color too. Maybe that’s what you want, though. ;-D

Subscribe to the Discussion

Get the ongoing discussion surrounding "Remove All Local Formatting Globally" delivered to you. Click here to subscribe via RSS.

Leave a Reply

You can use limited HTML tags, such as <em></em> for emphasis/italics and <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> .

InDesignSecrets reserves the right to edit and/or remove posts and comments.