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

Redefine Paragraph and Character Style Script?

Return to Member Forum

  • Author
    Posts
    • #114986
      Billy Chase
      Member

      Is there a script where I can redefine paragraph and character styles in fell swoop?

      Like for instance, if I resize the document then I get the point sizes in the parentheses. So I just want the script to select each style and choose to redefine the style to correct the point size.

      I basically want the script to select the style, “right-click” to refine it and move on.

      Thanks for your help.

    • #115011
      Billy Chase
      Member

      I’ve been trying to figure this out by seeing if another script can get me part of the way there but no dice.

    • #115971
      Brian Pifer
      Participant

      Not sure this will work as I don’t have access to ID currently and am a bit rusty, but I would try something along the lines of:

      var myPars = app.document.paragraphs.everyItem();

      for (var num = 0; num < myPars.length; num++) {
      var revisedPointSize = myPars[num].texts.anyItem().pointSize;
      myPars.appliedParagraphStyle.pointSize = revisedPointSize;
      }

      It could be made more elegant by skipping styles already fixed, or I could be approaching it totally backward or incorrectly, but that’s how I would start. This only accounts for point size and not other properties that might be changing, or character styles, but hopefully it helps you start to tackle it.

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