My InDesign document have one story and one paragraph. e.g "Hello world.. have a nice day"
Now I had applied a para style say 'myPara' to paragraph.
Now I select entire para and changed its font-size to 24px to make paragraph override.
Now I want to clear this paragrap override I tried the api
clearOverrides(OverrideType.PARAGRAPH_ONLY) but this won't work.
if call the api with default argument which is clearOverrides(OverrideType.ALL) then it works.
but only needs to remove the paragraph override and intact the character overrides.
It seems to be identifying this as a character override and hence the following seems to work
Why this is so, I am also confused
Thanks for your quick relpy, yes with passing argument OverrideType.CHARACTER_ONLY will clear the override but it also clear the character overrides whereas I wants character overrides intact.
I'm a bit confused now. Just to make that clear:
To change the point size is a character override. That the override is in every character of a paragraph makes no difference. It's still a character override. You can check that when you turn on the Style Override Highlighter as I did in the screenshot below.
One can consider all overrides to properties that can be applied to a single character as character overrides.
That said: Exceptions are the properties like appliedParagraphStyle, composer or justification etc.pp. that work for whole paragraphs only. The exceptions can be applied by scripting to a range of characters, but they cannot be applied with the Characters panel or the Character Styles panel.
( ACP )
Uwe explained why this is not working as you might think. If point size is the only concern, you can reset a text's point size to the applied paragraph styles point size, ie: app.selection.pointSize = app.selection.appliedParagraphStyle.pointSize;
Thanks for all the reply.
My only concern is not the pointSize it is about why api clearOverrides(OverrideType.PARAGRAPH_ONLY) does not work when I want to remove paragraph overrides.
Please Went through the followings attachments
As you can see that in step one character style bold has family and style.
and in step2 when I change the font size then it shows override in paragraph style panel.
if point-size is a character style attribute then why it does not shows as overrides in character style panel.
Hope all of you understand my problem.
Moreover do we have any mechanism or api which tells me that override on textstylerange have character override or paragraph override.
You could always just reapply the paragraphStyle and clear overrides on that reapplication:
I would agree with the general sentiment that it is unintuitive...like many things with ES, unfortunately.
the paragraph style name in the Paragraph Styles panel shows a + for any overrides.
Not only paragraph overrides ( e.g. you do define also point size with a paragraph style so if there is an override with point size the + sign will show up ).
A character style name in the Character Styles panel will only indicate overrides, the + sign, if you override one of the applied properties that is defined in that style. For example: If you defined one property only in a character style, let's say the fill color of a character, the + sign will not show up, if you change the point size. Why? Because a specific point size is not defined in that character style.
( ACP )
Yes I observed same behaviour then how we can identify using script api or code that partiular override is a character or paragraph override.