Script to remove overrides

Enthusiast ,
Sep 21, 2011 Sep 21, 2011

Copy link to clipboard

Copied

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.

TOPICS
Scripting

Views

6.9K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 21, 2011 Sep 21, 2011

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Sep 21, 2011 Sep 21, 2011

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 21, 2011 Sep 21, 2011

Copy link to clipboard

Copied

Yes.

It only removes paragraph level overrides.

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

Harbs

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Sep 21, 2011 Sep 21, 2011

Copy link to clipboard

Copied

Harbs,

Got a chance to try out your script this evening. I'm using InDesign CS5. I saved the script as a plain text file with a .jsx file extention, and put the script into the User folder inside the Scripts folder.

It shows up in the InDesign Scripts panel. I tried using it by selecting a couple of paragraphs with overrides, and then clicking on the script in the Scripts panel. It didn't remove the overrides. These paragraphs have nested styles, so I thought that perhaps I need to remove the "OverrideType.PARAGRAPH_ONLY"

The revised script looks like this:

app.selection[0].clearOverrides;

However, that didn't work either.

What am I doing wrong that the script isn't working for me? I hope that you have a suggestion.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Sep 21, 2011 Sep 21, 2011

Copy link to clipboard

Copied

Harbs,

Adding to my message, if I select each paragraph one at a time, and Alt-Shift-click on the style in the Paragraph Styles panel, it removes the overrides. Of course, I'm trying to avoid doing one paragraph at a time.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Sep 22, 2011 Sep 22, 2011

Copy link to clipboard

Copied

Jay,

Experiment with different types of override:

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

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

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

Your app.selection[0].clearOverrides will never work: it's a method and should always have two parentheses at the end: app.selection[0].clearOverrides(). Don't know if that'll work, though.

Peter

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 22, 2011 Sep 22, 2011

Copy link to clipboard

Copied

The default of clearOverrides() is OverrideType.ALL

so

app.selection[0].clearOverrides(); is the same thing as app.selection[0].clearOverrides(OverrideType.ALL);

Harbs

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Sep 22, 2011 Sep 22, 2011

Copy link to clipboard

Copied

Aha! Thanks.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 03, 2017 Dec 03, 2017

Copy link to clipboard

Copied

Thank you. More than 6 years after you posted this it let me get rid of the odious "ideoSpaceBehavior" override that no one to my and Google's knowledge ever solved! BTW, in more than 10K paragraphs where the usual alt-click to remove overrides would only do 1 para at a time.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 13, 2021 Jan 13, 2021

Copy link to clipboard

Copied

LATEST

That ideoSpaceBehaviour thing has snuck into some of my style sheets, and I have no idea how to get rid of it. How did this help?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Sep 21, 2011 Sep 21, 2011

Copy link to clipboard

Copied

Harbs,

Another thought. If this script removes overrides from only one paragraph style at a time, could it be revised to list all of the paragraph styles that need overrides removed?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Sep 23, 2011 Sep 23, 2011

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Sep 24, 2011 Sep 24, 2011

Copy link to clipboard

Copied

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

By all means do.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jul 23, 2018 Jul 23, 2018

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jul 23, 2018 Jul 23, 2018

Copy link to clipboard

Copied

I don't think he did. Those key strokes you mentioned are keyboard equivalents of the clearOverrides() parameters.

P.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jul 23, 2018 Jul 23, 2018

Copy link to clipboard

Copied

Thanks, Peter!

Best,
Uwe

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines