Skip navigation
CambLSAT
Currently Being Moderated

Add 2 to starting page number.

Apr 22, 2012 11:03 PM

Tags: #cs5 #indesign #scripting #numbering #page #number

Hi guys,

 

I have a very basic scripting need. What I need is for a script to retrieve the number of the first page in a document and then renumber that same starting page by adding 2 to it. Thanks.

 
Replies
  • John Hawkinson
    5,572 posts
    Jun 25, 2009
    Currently Being Moderated
    Apr 22, 2012 11:21 PM   in reply to CambLSAT

    Do you have to do this repeatedly? It seems easier to just do it by hand?

    Also, do you want the second page of the document to stay where it was? Such that the third page is numbered the same as the new number of the first page? If so, you'll need to create a new section starting on the 2nd page. Unless you have already done so?

     

    I'm having trouble imagining why you would want to do this...

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 23, 2012 1:00 AM   in reply to CambLSAT

    @CambLSAT – if you are on InDesign CS5 or CS5.5 you could do that by the "startPageNumber" property of the DocumentPreferences like that:

     

    myDocument.documentPreferences.startPageNumber = myDocument.documentPreferences.startPageNumber + 2;
    

     

    To apply it to your 250+ documents you have to open all the documents, apply the new number, save and close the document.

    You could do that in a loop.

     

    Or you could stick all your documents into a InDesign book file and adress all docs in that book running a loop through all docs in that book.

     

    Uwe

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 23, 2012 4:26 AM   in reply to Laubender

    > Or you could stick all your documents into a InDesign book file and adress all docs in that book running a loop through all docs in that book.

     

    Or simply do "Update all page numbers" in the book. No need for a script.

     

    Peter

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 23, 2012 6:43 AM   in reply to Peter Kahrel

    @Peter – true, if all the 250+ files belong to a book and have subsequent page numbers.

     

    Uwe

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 23, 2012 6:50 AM   in reply to Laubender

    Ah, a loop might be needed anyway because an InDesign book can contain only 130 documents.

     

    Peter

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 23, 2012 7:54 AM   in reply to Peter Kahrel

    … because an InDesign book can contain only 130 documents.

    Ouch! Never realised that. Peter, thank you for pointing this out.
    Does this number differ per InDesign version?

     

    After testing with InDesign CS5.5: I could not verify that number.

     

    See screenshot (150 InDesign files in one book):
    (Maybe other circumstances will be a limit: overall file size, memory restrictions?)

     

    150_InDesign_Files_in_one_book.png

     

    Uwe

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 23, 2012 9:14 AM   in reply to Laubender

    Uwe,

     

    You're absolutely right, I should have checked more recently. The 130-document limit was for CS 4, I never tried in CS 5/5.5. I've just now stuck 1500 documents in a book, so clearly that limitation was removed at some point.

     

    Peter

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 24, 2012 6:27 AM   in reply to Peter Kahrel

    The fog has cleared: I was reminded that you can place as many documents in a book as you like, but you can open only 136 documents at the same time. This is a problem for book functions for which InDesign needs to open all the book's documents, such as generating an index.

     

    Peter

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points