2 Replies Latest reply on Feb 26, 2009 7:47 AM by ekipartner

    JS how to get whole content of paragraph of found text (CS4)


      Can you tell how to get the content of whole paragraph of found text? I´ll get the content of whole story. How to define paragraph?

      // Sample data in InDesign
      // A100 (tab) 1234 (tab) 5678 (ret)
      // B100 (tab) 1234 (tab) 5678 (ret)
      // C100 (tab) 1234 (tab) 5678 (ret)

      app.findTextPreferences = null;
      app.findTextPreferences.findWhat = "B100";
      myFound = app.activeDocument.findText();

      myFoundText = app.selection[0].contents // shows content of selected item
      alert ("selection is: " + myFoundText)

      myFoundText = app.selection[0].parent.contents // shows content of whole story, but only the content of parapgraph of found item?
      alert ("content is: " + myFoundText)