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.
Copy link to clipboard
Copied
app.selection[0].clearOverrides(OverrideType.PARAGRAPH_ONLY);
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.
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
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.
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.
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
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
Copy link to clipboard
Copied
Aha! Thanks.
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.
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?
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.
Copy link to clipboard
Copied
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
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?
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.
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.
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
Copy link to clipboard
Copied
I don't think he did. Those key strokes you mentioned are keyboard equivalents of the clearOverrides() parameters.
P.
Copy link to clipboard
Copied
Thanks, Peter!
Best,
Uwe