3 Replies Latest reply on May 6, 2011 9:31 AM by csm_phil

    how to get associatedXMLElement of myDoc.findText().[some index]

    getZinger Level 1

      I'm trying to get the markupTag of a found result, all text is tagged.

      Say I'm looking for "a",

       

          app.findTextPreferences.findWhat = "a";
          myFinds = myDoc.findText();
             
          for (myFindIndex=0; myFindIndex < myFinds.length; myFindIndex++) {
              //here I thought I could get the insertionPoint of the result,

              var myIndex = myFinds[0].insertionPoints[-1].index;
              alert(myFinds[myFindIndex].parentStory.insertionPoints[myIndex].associatedXMLElement.mark upTag.name)

               //this object however has no associated element...

              //myIndex gives the right index for the insertionpoint

                // when retreiving the insertionpoints parent, I get Story, which has a parent Document, so I can't readdress the insertionpoint.

                //Main problem seems to be that insertionPoints don't have an associated element, I guess.
              }

       

       

      Who can give this a friendly try on an friday afternoon (depending on your region)?