Skip to main content
Inspiring
September 21, 2011
Question

Script to remove overrides

  • September 21, 2011
  • 2 replies
  • 10728 views

Does anyone know of a script that can remove paragraph overrides from text that is selected with the Type tool?

I have many paragraphs that have nested styles. InDesign does not implement the nested style untl I select the paragraph and Alt-click the style in the Paragraph Styles panel to remove the override. After that, the paragraph has the correct formatting.

This is hugely time-consuming because I have to place many such paragraphs in a very long document.

I don't want to remove overrides throughout the whole document, just those paragraphs that are selected. That way, I can place a bunch of text into InDesign, select the text and remove the overrides, before moving it into place on the layout.

If anyone can help, it would be a tremendous relief to me.

This topic has been closed for replies.

2 replies

Inspiring
September 24, 2011

Thank you Harbs and Peter, for your suggestions.

I tried the following scripts, none of which have worked:

app.selection[0].clearOverrides()

app.selection[0].clearOverrides(OverrideType.CHARACTER_ONLY);

app.selection[0].clearOverrides(OverrideType.PARAGRAPH_ONLY);

app.selection[0].clearOverrides(OverrideType.ALL);

Unfortunately, InDesign is still clinging tightly to the overrides. If it would help for me to upload a few paragraphs for you to look at, let me know.

Peter Kahrel
Community Expert
Community Expert
September 24, 2011

> If it would help for me to upload a few paragraphs for you to look at, let me know.

By all means do.

Community Expert
July 23, 2018

Hi Peter,

I know this is a very old discussion.

But can you remember if Jay Fresno provided a sample text where clearOverrides() did not work entirely?

And perhaps alt + click or alt + shift +click the paragraph style did work?

Thanks,
Uwe

Harbs.
Legend
September 21, 2011

app.selection[0].clearOverrides(OverrideType.PARAGRAPH_ONLY);

Inspiring
September 21, 2011

Harbs,

Thank you so much for your quick reply. Does this script remove overrides in multiple types of paragraphs?

I need to select a bunch of paragraphs, each paragraph may have a different style applied to it, and remove the overrides from all of them at once.

Harbs.
Legend
September 21, 2011

Yes.

It only removes paragraph level overrides.

If you need it to remove all overrides, remove the argument: OverrideType.PARAGRAPH_ONLY

Harbs