4 Replies Latest reply on Mar 15, 2013 6:30 AM by JohnDevlon

    [CS5.5][JS] How to find out position of insertionpoint text search result?

    JohnDevlon Level 1



      With this post I would like to ask a question.


      Using this piece of code I'm able to get all text occurenses of the letters "TO". This works great...


      app.findTextPreferences = NothingEnum.nothing;

      app.findTextPreferences.findWhat = "TO";

      var myResults = app.activeDocument.findText();                                                     

      var insertionPoint = myResults[0].insertionPoints[0];


      What I would like to know: how do I find out if the letters are the first 2 letters of the paragraph it's used in? How do find out what the index is in the paragraph?

      And how do I find out if, before the current search result position, a anchored object is present?


      Any feedback will be appreciated.