7 Replies Latest reply on Feb 24, 2010 4:42 AM by AdobeScripts

    [InDesign CS3] - How to select the partially text from the selection

    Anil Yadav Level 1
      Hi,

      I have an XML embedded InDesign file in which some page numbers are given under link tag. The first page information, before endash(–), will be link to "start" attribute and sendcond page information, after the endash(–), will be link to "end" attribute.

       

       

      The first page informatio is 125 and the second page information is 26 in the below example.

       

       

      <link start="c51351-549" end="c51351-550">125–26</link>
      

       

       

      Everything I have done but not able to select both the informations individually to link means I have to first select the 125 and link, and after that I have to select 26 and make a link. I'm using the followin code to select the information which select both 125 and 26 with endash.

       

       var root  = myDoc.xmlElements[0];
       var xpath = "//link";
       var node  = null;
       try
       {
        var proc  = app.xmlRuleProcessors.add ([xpath]);
        var match = proc.startProcessingRuleSet (root);
        while( match!=undefined )
        {
         node = match.element;
         myDoc.select(node.texts);
         sourceText=myDoc.selection[0];
      

       

      Please, could you look into this and do the needful.

       

      Thanks,

      Anil Yadav