1 Reply Latest reply: Apr 14, 2009 3:11 AM by [Jongware] RSS

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

    LeonardoAgosti MeganK

      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?

        • 1. Re: [JS] How to break link to paragraph style from script?
          [Jongware] CommunityMVP

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