• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

8.9K

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);

Votes

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.

Votes

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

Votes

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.

Votes

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.

Votes

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 Expert ,
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

Votes

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

Votes

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 Expert ,
Sep 22, 2011 Sep 22, 2011

Copy link to clipboard

Copied

Aha! Thanks.

Votes

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.

Votes

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 ,
Jan 13, 2021 Jan 13, 2021

Copy link to clipboard

Copied

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?

Votes

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 ,
Jul 23, 2022 Jul 23, 2022

Copy link to clipboard

Copied

@Peter Kahrel Wow thats a great sharing.
What would be a good exampel of Paragraph_only override and Character_only override. 

I colored a paragraph and tried paragraph_only overide code mentioned above. It did not work. OveridtyTypeAll is working. I havent tried Character_only. Thats the reason I ask. Thanks in advance.

Votes

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 ,
Jul 23, 2022 Jul 23, 2022

Copy link to clipboard

Copied

LATEST

Ok finally I understood what it means.

Character only styles are covered by Character Panel in Indesign. Similarly Paragraph Only styles are covered by Paragraph Panel. All covers both.

Thanks

Votes

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?

Votes

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.

Votes

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 Expert ,
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.

Votes

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 Expert ,
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

Votes

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 Expert ,
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.

Votes

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 Expert ,
Jul 23, 2018 Jul 23, 2018

Copy link to clipboard

Copied

Thanks, Peter!

Best,
Uwe

Votes

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