The Document Object Model of the InDesign CS4 scripting layer provides an obscure property, TextPreference.enableStylePreviewMode, which allows to show “style overrides” as red strikeouts or paragraph vertical bars in normal screen mode (as illustrated above). After hours of investigation, I have not figured out how to access this feature from the InDesign user interface. Maybe I'm wrong, but it looks like this way of reporting local formatting is only available through scripting. (Please add a comment if I missed the obvious!)

Anyway this is a great feature. Usually we detect an override by selecting a target text range and checking the style name in the Paragraph Styles and/or Character Styles panel(s). A plus sign (+) next to the style name indicates that a local formatting overrides the style's attributes. (See “Override character and paragraph styles” in the InDesign online help.) But that approach is useless if you need a global overview of the style gaps after importing from Word, or similar operations.

(Note: you can define a Preflight Profile to report style overrides.)

Now to the script

ShowHideLocalFormatting.js is the shortest script I've ever written. It simply toggles between the normal view mode and our special “display style overrides” mode:

if (
  app.documents.length &&
  app.activeDocument.textPreferences.enableStylePreviewMode^= 1 &&
  app.layoutWindows.length &&
  app.activeWindow.screenMode = ScreenModeOptions.previewOff;
  // UPDATE 05/25/10 - Thanks to ptruskier
  app.activeWindow.overprintPreview = false;

The above code contains extra stuff to prevent the script from contextual errors, anyway the only important instruction is:

app.activeDocument.textPreferences.enableStylePreviewMode^= 1;

which switches the enableStylePreviewMode flag.

Here is a typical result:

Red markers indicate style overrides.

If it turns out that this display feature is not available natively in InDesign CS4, I strongly encourage you to attach a keyboard shortcut to the script!

• See also: The Hidden Way to Highlight Styles