This content has been marked as final. Show 9 replies
What you have to do is make a new temp character style, apply it and then delete the style.
Ah, Robin could well have put his finger on it. I always forget about ApplyStyle.
Phew, lightening speed answers; thank you so much.
Well, Robin definitely spotted a syntax error. But correcting it hasn't
helped. Whereas Dave's suggestion does work. IOW, applying a user-defined
character style does change the formatting, but not [None], even though
through the UI it does work.
you can put in clearOverrides() after applying the style for the [None]
Do you mean apply that to the paragraph style?
I mean, assuming "text" is a reference to the text you are applying
Probably, because the applyCharacterStyle doesn't have an clearingOverrides parameter ...
Clearing the overrides for the entire paragraph is a bit overreacting. Try this text method instead:
>clearOverrides ([overridesToClear: OverrideType=ALL]);
-- the overridesToClear defaults to ALL, but you can specify PARAGRAPH_ONLY or (hey!) CHARACTER_ONLY.
I think I'll still go for Dave's suggestion. I do sometimes use local
formatting and, if I've understood correctly, your suggestion will strip all
local character formatting from the paragraph.