Search code examples
adobe-indesignextendscript

Set page numbering in InDesign (with extendscript)


In InDesign, I can set the page numbering options to start at any number. Like this (starting at 5):

enter image description here

Please note that this is not the same as page markers as text in the document. I need to change it in the Pages panel.

My question is: How can I do this with ExtendScript? I have figured out how to read it from the active page:

app.activeWindow.activePage.name

But I want to change it, something like this:

i = 1;
for each page
  app.activeWindow.activePage.name = i;
  i++;
end

Is it possible?


Solution

  • Try this

    app.activeDocument.sections[0].continueNumbering = false;
    app.activeDocument.sections[0].pageNumberStart = 5;
    

    and have a look at these links:

    http://yearbookmachine.github.io/esdocs/#/InDesign/Section/continueNumbering http://yearbookmachine.github.io/esdocs/#/InDesign/Section/pageNumberStart