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

Export specific styled text and page number

Return to Member Forum

  • Author
    Posts
    • #105178
      Anonymous
      Inactive

      Hello, I am new to InDesign scripting and am looking for a possible solution.

      I have a large document that I need to extract specific text from. All of the text I need has been styled with the same point size, font style and type.

      The type is setup as follows:

      Helvetica Neue LT Std
      8 pt
      75 Bold

      I am hoping someone might have done this or something similar before, but I could not find anything similar on the forums.

      Any help would be greatly appreciated.

      Thank you in advance.

    • #105181

      What does extract mean?

      app.findGrepPreferences = app.changeGrepPreferences = null;
      app.findGrepPreferences.properties= {
        fontFamily: "Helvetica Neue (T1)",
        fontStyle: "75 Bold",
        pointSize: 8	
      };
      
      var res = app.activeDocument.findGrep();
      app.findGrepPreferences = app.changeGrepPreferences = null;
      var nRes = res.length;
      var listToDisplay = [];
      
      for (var i = 0; i < nRes; i++) {
        listToDisplay.push(res[i].contents);
      }
      
      alert(listToDisplay.join("\r"));
      
Viewing 1 reply thread
  • You must be logged in to reply to this topic.
Forum Ads