0 Replies Latest reply on Jan 29, 2010 11:03 PM by dhishok

    find xml elements and move it to new frames...

    dhishok

      Hi everyone,

       

      We are currently working in InDesign XML in CS4. I am trying to push the Figure caption texts into new text frames using grep. And i have did the same. But the concern is while pushing those contents the xml tags are get removed.

       

      Can anyone suggest that how to find the xml elements and move those to new text frames. Below is my script lines.

       

      //---------------

      app.findGrepPreferences = app.changeGrepPreferences = NothingEnum.NOTHING;
      app.findGrepPreferences.findWhat="\\[\\[C.+\\]\\].+\\[\\[E.+\\]\\]";

       

      var myTframe=app.activeDocument.textFrames.add();
      var myFind=app.findGrep(true);
      for (s=0; s<myFind.length; s++)
      {
          myFind[s].move(LocationOptions.after, myTframe.insertionPoints[0]);
          if (myTframe.texts.item(-1).contents!="\r"){
              myTframe.texts.item(-1).contents="\r";
              }
          }
      myTframe.fit(FitOptions.frameToContent);

       

      //--------------

       

      Suggest me for this and your help will be much appreciated.

       

      Thanks & Regards

      Thiyagu