Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Apply Grep style to Paragraph Style

Return to Member Forum

  • Author
    Posts
    • #83974
      volander
      Member

      Hello all,

      This is my first post, so be gentle! :)
      So far I’ve created a paragraph style and a character style in my script.
      Then I searched for a way to apply the character style onto the the paragraph style within the “grep style” option and then apply a specific grep.
      Sadly I haven’t been able to find any examples and the scripting guide doesn’t show how either.

      app.activeDocument.characterStyles.add({name:”Character – No Break”, noBreak: true})
      app.activeDocument.paragraphStyles.add({name:”Paragraph – No Break”})

      This is where im at now, hope you guys can help.

    • #83989
      Peter Kahrel
      Participant

      Something like this:

      pstyle = app.activeDocument.paragraphStyles.add({name:"Paragraph – No Break"});
      pstyle.nestedGrepStyles.add ({
        appliedCharacterStyle: app.activeDocument.characterStyles.item('Character – No Break'),
        grepExpression: '. . .'
      });

      Peter

    • #83996
      volander
      Member

      It doesn’t work either and thats not what im really trying to do.

      This is what im trying:
      Paragraph Style Option > GREP style > Apply my character style > then write my own grep

    • #83997
      Peter Kahrel
      Participant

      In what way does that code not work? Works fine for me.

      Explain in some more detail what you want to do, because clearly I don’t understand it. You have a character style and a paragraph style. And you want to set up a Grep style in the paragraph style using that character style. Correct?

    • #83998
      volander
      Member

      It works perfectly dude! Just me who failed to implement it properly into my own lines of code!
      Thank you so much :)

Viewing 4 reply threads
  • You must be logged in to reply to this topic.
Forum Ads