9 Replies Latest reply on Feb 24, 2009 8:47 AM by (Timblin_Judy)

    Help with syntax: Adding pages JS CS3

      I'm fairly new to scripting and I'm trying to write a script to add pages, inserting one after each existing page. We're doing postcards using a 4-up data merge. On the back of each card is the data merge/address (again, 4 to a page). Since the merge doesn't work on alternating pages, we want to do the merge first, then add the face pages afterward.
      This is my code thus far:

      var myPages = app.activeDocument.pages;
      var myCounter = myPages.length-1;

      for (i = myCounter; i >= 0; i--){

      myPages.add(LocationOptions.AFTER)...;

      }

      On the line "myPages.add(LocationOptions.AFTER)..." I have tried every combination I can think of based on the CS3 Object Model that comes with Extend Script. Every one except the right one.

      Many thanks for you help.
      -Tim