I was recently needing a way to clear all overrides in a 100+ page book. The book was divided into many separate stories, so it was not possible to simply “select all” and click on the “Clear overrides” button.
Instead of going through each story in turn, selecting all the text there, clearing overrides, and repeating that for each story in the document, I wrote a quick script.
(In fact, if it is necessary to clear all local overrides in footnotes it can be even more time-consuming, as there is no way to select all footnotes in one go. Rather, it would be necessary to clear the overrides one footnote at a time – although if the footnotes have a paragraph style applied then there is a shortcut for doing this.)
The script below will clear all paragraph-level and character-level overrides in the active InDesign document.
To use, simply copy the script into your favorite text editor, save with a .jsx extension, and place into your InDesign Scripts folder.
// Clear All Overrides // Written by TAW. (c) 2014 by Bookraft Solutions, Israel (Id-Extras.com) // Please do not delete this copyright notice. // var myOverrideType = OverrideType.ALL; // var myOverrideType = OverrideType.CHARACTER_ONLY; // var myOverrideType = OverrideType.PARAGRAPH_ONLY; var allStories = app.activeDocument.stories.everyItem(); // Remove overrides from all stories try{ allStories.clearOverrides(myOverrideType); } catch (e){alert ("No stories!")} // Remove overrides from all footnotes try{ allStories.footnotes.everyItem().texts.everyItem().clearOverrides(myOverrideType); } catch (e){alert ("No footnotes!")} // Remove overrides from all table try{ allStories.tables.everyItem().cells.everyItem().paragraphs.everyItem().clearOverrides(myOverrideType); } catch (e){alert ("No tables!")} alert("Overrides cleared!");
As is, the script will clear all overrides throughout the document from all text, including all text in tables and footnotes. It will clear paragraph-level overrides as well as character-level overrides.
However, it is easy enough to modify the script to suit your needs.
First of all, if you need to clear only paragraph-level overrides, or only character-level overrides, simply comment out the relevant line: Of lines 7, 8, and 9, exactly two should be commented out. (I may add a UI if I get the chance.)
Then, if you do not need to delete overrides from tables, footnotes, or regular text, comment out the appropriate lines there too. It should be self-evident how to do this, but if you have a question, leave a comment below.
Clark Kenyon
February 8, 2023 10:54 pmI’m working on a book layout. The original manuscript in Word is full of direct formatting (e.g., “Normal+Italic”). I changed all the italics in that document to a single character style (Italic), but apparently this did not catch all the original TNR italics. I noticed this when I placed the Word doc in my ID template. I tried this script on the InDesign layout, and it worked ok, but instead of removing the TNR overrides in the footnotes, it just removed all of the italic styling.
Ariel
February 8, 2023 11:29 pmHi Clark,
It will remove all overrides – so anything that doesn’t have a specific character style will be removed. I guess somehow that was the case with the italics styling?
Ariel
Clark Kenyon
February 11, 2023 1:19 amYou’re right. The overridden text did not have a specific italic styled applied to it.