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

Paragraph Styles

Return to Member Forum

  • Author
    Posts
    • #113467

      Hi,

      I tried to create a Paragraph style using the script. I used the following:

      var myDoc = app.activeDocument;

      var myTitleStyle = “eb-Title” // Title
      var mySubTitleStyle = “eb-SubTitle” // SubTitle
      var myParaText = “eb-ParaText”
      var myReference = “eb-Reference”

      var myFont = “LathaRegular”

      try{
      var pstyle = myDoc.paragraphStyles.add(mySubTitleStyle);
      with(pstyle) //Change the below lines as per your requirement
      {
      Name =mySubTitleStyle;
      appliedFont = myFont;
      pointSize = 13;
      leading=”18p”;
      tracking = 100;
      justification=Justification.LEFT_ALIGN;
      spaceAfter=”0p6″;
      spaceBefore=”0p4″;
      underline=true;
      }
      }
      catch(e)
      {
      alert(“‘” + mySubTitleStyle + “‘” + “already exists in the document.”)
      }

      But, it errors out saying that “Object does not support the property or method paragraphstyles”. Any clues?
      Thanks in advance.

    • #113483
      Peter Kahrel
      Participant

      paragraphstyles should be paragraphStyles (JavaScript is case-sensitive). But it’s spelled correctly in your code. And your script works fine.

      P.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.
Forum Ads