6 Replies Latest reply on Aug 1, 2011 2:39 PM by swingcarlos

    Page duplicate() failing on Server

    swingcarlos Level 1

      I have been porting over a script that originally ran on InDesign server CS3, to CS5.

      I am taking a template file and replacing some text.  Looks like this.


        var page = myDocument.pages.item(0);

        var templatePage = page;


          for(var i=0 ; i<myArray.length ; i++)


              if (i > 0)


                  page = templatePage.duplicate();


              myLogFile.writeln("Document Page Count: " + myDocument.pages.length + " Page Index: " + page.index);





      When this code is run locally on my desktop, it creates separate pages correctly (3 for my test data).

      When I run this script on the a CS5 server I get only 2 pages.  Imagine the first page

      comes out correctly, and then the 2nd and 3rd are merged horizontally for a single double wide page.


      Here is what the output of the logfile message looks like:

      Document Page Count: 1 Page Index: 0

      Document Page Count: 2 Page Index: 0

      Document Page Count: 3 Page Index: 1


      Notice that the page count is correctly incremented, but for some reason the index is not. This logging

      looks the same on both desktop and server. It's just that the desktop version somehow displays 3 separate

      pages, which is correct.


      Any known wonkiness with duplicate()?