2 Replies Latest reply on Mar 10, 2008 8:25 AM by KeithGilbert

    [JS CS3] Moving pages from one doc to another

    KeithGilbert Level 1
      I'm having trouble understanding the pages.move method, when used to move pages from one file to another. With one ID file open, I want to create another file, and then move pages from the first file to the second. At this point, the new, second file is untitled. Must I save it first? Here is what I have so far...

      var oldDocument = app.activeDocument;
      var newDocument = app.documents.add();
      // Move pages
      oldDocument.pages.itemByRange(0,1).move(LocationOptions.after,newDocument.pages[-1]);

      I'm having trouble figuring out how to reference both documents properly.