2 Replies Latest reply on Aug 3, 2008 9:16 PM by (suvoWillShine)

    Script for numbering pages

      Do you have a script which will number the pages from 0 ? The numbering and section options dialog box only allow us to start numbering from 1.

        • 1. Re: Script for numbering pages
          Level 1
          Hi suvo.<br /><br />If the GUI doesn't allow numbering from 0 you can be quite sure that scripting doesn't allow it as well...<br /><br />IMHO the only thing you can do is to write your own page numbers into a textframe.<br /><br />Therefore create a textframe, label it and then write your script....<br /><br />>var txt1;<br />var page1;<br />var pageNum1;<br /><br />>with (app.activeDocument.textFrames) {<br />  for (var i=0; i<count(); i++) {<br />    txt1 = item (i);<br />    if (txt1.label == "pageNumberTextframe") {<br />      page1 = txt1.parent;<br />      if (page1.constructor.name == "Page") {<br />        pageNum1 = parseInt (page1.name);<br />        if (pageNum1 != NaN) {<br />          txt1.contents = String (pageNum1 - 0);<br />        }<br />      }<br />    }<br />  }<br />}<br /><br />Greetings,<br />Marc