[Allegory depicting the struggle of the meticulous designer against the + sign in InDesign, by Frédéric ROBIN]

You have an InDesign document with text formatted using styles, but some parts of the text show various attribute overrides or local formatting, highlighted by the plus sign (+) displayed next to the style name. Most overrides are deliberate and must be preserved, but we want to selectively suppress some of them, for example all occurrences of the “underlined ”local formatting overriding a given style sheet in the whole document. Of course it is possible to do a fastidious “Find-replace” based on attributes with repetitive use of the “Clear Overrides” command. But the Ukrainian designer Wadym Martynowski told me about a technique he developed:

  1. Select (or place the cursor in) some text with a paragraph style applied and some unwanted overridden attributes (causing the “+” to be displayed),
  2. Duplicate the applied paragraph style,
  3. Redefine the original style from selection to include the unwanted attribute (for example all the styled text becomes underlined),
  4. Delete the original style, replacing it with its copy kept without the unwanted attribute, this attribute then disappears everywhere the style is applied in the document,
  5. Rename the copy with the original style name.

perfectionist of styles 004en 01 12So this new script is the automated version of this process. But this automation wasn’t easy[1], I received help from Uwe Laubender, Timothy Ariel Walden and especially Kasyan Servetsky to solve some problems actually caused by a bug in Russian-localized InDesign versions. Then I also worked further on improving it for some specific cases submitted to me by Wadym, where some unwanted replacements were not suppressed neither with the manual method nor with its equivalent scripted version, or where it suppressed replacements that should be preserved (such as a “bold” attribute applied using a character style causing the overridden “bold” attributes to disappear elsewhere). I also included the equivalent routine for character styles. In this final release some limitations remain eventually: for example in the case where the overrides affect both a paragraph style and a character style simultaneously applied to the selected text, it turns out sometimes (for example when the weight matches neither the paragraph style nor the character style) impossible to eradicate the unwanted attribute for all the occurrences of the paragraph style, but only for the character style.

The examples showed here are the “underlined” and other visible attributes in order to provide a more explicit demonstration, but sometimes we want to suppress some invisible replacements affecting unused attributes (drop-cap alignment/scale parameters in a style without drop-cap, new parameter from CC 2015 version “paragraph shading color”, affected by a default value although unchecked when opening a document saved in an older version, advanced undocumented OpenType parameters such as “IdeoSpaceBehavior”) nevertheless causing a “+” sign to be displayed, irritating for meticulous designers like Wadym Martynowski or me, hence the name of this script “perfectionist-of-styles”.

[1] Since the “Redefine style” command has no equivalent in the InDesign ExtendScript API, we need to simulate the manual selection of this command from the menus of the user interface, by invoking a “MenuAction”.

You have no rights to post comments

Follow Scriptopedia.org

feed-image Follow Scriptopedia.org

Scriptopedia sur facebook

About Scriptopedia.org

An original idea from Loic Aigon, designed by Eddy.VH. It 's a scripts library for Desktop Publishing Adobe products. Find Javascript for Photoshop, Illustrator, inDesign and Acrobat or ATN scripts ( Photoshop actions ) you need.