1 Reply Latest reply on Mar 19, 2009 6:18 PM by christianbrugeron

    select all text between pages (CS3, JS)

    christianbrugeron Level 1
      Hi,

      I'd like to select all text between 2 pages.
      So I can call export to xhtml with that selection.

      I tried with textFrames and adding to a selection, but got the error "cannot select across spreads".

      Any clue?

      Thanks
      Christian
        • 1. Re: select all text between pages (CS3, JS)
          christianbrugeron Level 1
          solution

          var theDocument = app.activeDocument;

          start = 44;
          end = 55

          for (i = start; i< end; i++)
          {
          var laPage = theDocument.pages.item(i);
          try {
          target = laPage.textFrames[0].texts;
          if (i == start) {
          app.select(target,SelectionOptions.REPLACE_WITH); // noter le replace
          }
          else
          {

          app.select(target,SelectionOptions.ADD_TO);// le add to ne marche que s'il y a deja une selection ......
          }
          } catch(e) {$.writeln("page vide: "+i);};
          }