4 Replies Latest reply on Aug 11, 2011 2:35 PM by John Hawkinson

    [CS5][JS] Assign different page number to single page?

    lhanneman Level 1



      I'm wondering if it is possible, using javascript with CS5, to manually update the page number of any given page (For example, set the page number to 16, even if it is the only page in the document)? I know that the 'name' property contains the page number, but it is read only. I think it may be possible if I created the IDML from scratch, but that is not an option for what I'm working on. I've tried creating a new page and specifying a different page number like this:


      //Automatically set it to page number 16

      var myPage = myDoc.pages.add({name: '16'});


      But it does not work. It still shows page 1 if I alert the page.name value. The reason I ask is because I'd like to be able to use the AutoPageNumber special character. I'm creating several pages individually that will eventually be put together in a "book" and I'd like to have a text frame with that AutoPageNumber special character instead of just a number, mainly so that if later on they need to be re-arranged, the page number auto-updates itself.


      So, ideally, I'd like to be able to change the page number to any given number, and then add a text frame with the AutoPageNumber special character, and then it would show my provided page number, instead of what it really is relative to that document.


      Does anyone know how I may be able to accomplish this?


      Many thanks in advance for any advice/feedback/help!