Skip to main content
LeonardoAgosti
Known Participant
April 14, 2009
Question

[JS] How to break link to paragraph style from script?

  • April 14, 2009
  • 1 reply
  • 896 views

I don't found the command break link to paragraph style from script.

I want "unapply" the style from the text, but leave the formatting intact.

Can help me?

This topic has been closed for replies.

1 reply

Jongware
Community Expert
Community Expert
April 14, 2009

In the interface it's a separate command ("Break link to style"), but it seems in a script you have to use

Paragraph.applyParagraphStyle (using:ParagraphStyle[, clearingOverrides:bool=true])

You cannot use "null" or something similar for "ParagraphStyle", so I guess the idea is to use paragraph style #0 in your document (which is always "[No Paragraph Style]"). Be sure to set "clearing Overrides" to false, as it defaults to true.

The following single line works on your current paragraph:

app.activeDocument.selection[0].paragraphs[0].applyParagraphStyle (app.activeDocument.paragraphStyles[0], false);