2 Replies Latest reply on Sep 17, 2009 1:43 PM by SD - LCI Training SO

    [JS][CS3] Change "Start Peg Numbering at:""

    SD - LCI Training SO



      I have a big problem on many InDesign Books with approx. 158 files each. In fact I have cut the InDesign files of approx. 400 pages in 158 files with 2 or 4 pages each but when I cut my reference document it was configured with "Start Page Numbering at:" set to "1."


      Now I have 158 files with this option ("Start Page Numbering at:" set to "1."), my question it is possible by a script to change all the files of the book with the "Automatic Page Numbering" option selected, as is "Continue from Previous Document in the Book."


      With a such script I will win a lot of time on this operation and I'm not motivated to do this file by file.



        • 1. Re: [JS][CS3] Change "Start Peg Numbering at:""
          [Jongware] Most Valuable Participant

          Here you are. Works on CS.


          if (app.books.length != 1)
            alert ("Slow Reader Alert!\nI can only work on one book at a time.");
          for (doc=0; doc<app.books[0].bookContents.length; doc++)
            a_document = app.open (app.books[0].bookContents[doc].fullName);
            a_document.sections[0].continueNumbering = true;


          It's really straightforward. Line by line:

          1. You can have zero, or more than one book open. For simplicity, this script works on one and only one opened book.
          2. Eh. Group brace.
          3. Well. Speaks for itself.
          4. All done, bye bye.
          5. .. another group brace. This is going slower than I thought.
          6. Ah! A book contains an array objects of type "BookContent", which holds file name, creation date, and status (i.e., if the document needs updating). Its length is equal to the number of documents in the book, one per file.
          7. .. group brace ..
          8. (snore) oh, sorry. "Open this document". Yep.
          9. All documents have at least one section; the first is hardcoded to start at the first page. Since this is Javascript, it's section #0. The 'continueNumbering' is just a boolean value, yes or no: "If true, continues page numbers sequentially from the previous section."
          10. Close, save when necessary. This just means that if the document was not changed (because the numbering was allright), it won't be saved, just as in the user interface.
          11. Finally, the final closing brace.
          12. That's it.
          13. Really.
          14. (I could go on all day, y'know...)
          • 2. Re: [JS][CS3] Change "Start Peg Numbering at:""
            SD - LCI Training SO Level 1



            It is exactly what I needed. One thank you very much for your precious help.


            A great thanks