<html>
  <head>
    <meta content="text/html; charset=us-ascii"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <tt>Hi Jain,<br>
      <br>
      I've been testing the update. My assumption is that pages[] would
      access each page as if using activePage but without having to set
      the activePage. What happens is that, even though each page
      element references a different location, the return objects are
      always the last page of the document. Have I understood its use
      correctly?<br>
      <br>
      Thanks.<br>
      <br>
      ------------<br>
      Using the following in the script console on a 5 page test doc
      with dummy items on each page:<br>
    </tt><br>
    <code snippet><br>
    <meta name="qrichtext" content="1">
    <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
      margin-right:0px; -qt-block-indent:0; text-indent:0px;
      -qt-user-state:0;"><!--StartFragment-->ad =
      Scripter.activeDocument</p>
    <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
      margin-right:0px; -qt-block-indent:0; text-indent:0px;
      -qt-user-state:0;">pages = ad.pages</p>
    <p style="-qt-paragraph-type:empty; margin-top:0px;
      margin-bottom:0px; margin-left:0px; margin-right:0px;
      -qt-block-indent:0; text-indent:0px;"><br>
    </p>
    <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
      margin-right:0px; -qt-block-indent:0; text-indent:0px;
      -qt-user-state:0;">print "****** using pages[]"</p>
    <p style="-qt-paragraph-type:empty; margin-top:0px;
      margin-bottom:0px; margin-left:0px; margin-right:0px;
      -qt-block-indent:0; text-indent:0px;"><br>
    </p>
    <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
      margin-right:0px; -qt-block-indent:0; text-indent:0px;
      -qt-user-state:0;">for page in pages :</p>
    <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
      margin-right:0px; -qt-block-indent:0; text-indent:0px;
      -qt-user-state:0;"> items = page.items</p>
    <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
      margin-right:0px; -qt-block-indent:0; text-indent:0px;
      -qt-user-state:0;"> print " Page", page.number, "has", len(items),
      "item(s)"</p>
    <p style="-qt-paragraph-type:empty; margin-top:0px;
      margin-bottom:0px; margin-left:0px; margin-right:0px;
      -qt-block-indent:0; text-indent:0px;"><br>
    </p>
    <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
      margin-right:0px; -qt-block-indent:0; text-indent:0px;
      -qt-user-state:0;">print "****** using setActivePage()"</p>
    <p style="-qt-paragraph-type:empty; margin-top:0px;
      margin-bottom:0px; margin-left:0px; margin-right:0px;
      -qt-block-indent:0; text-indent:0px;"><br>
    </p>
    <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
      margin-right:0px; -qt-block-indent:0; text-indent:0px;
      -qt-user-state:0;">number = ad.pageCount</p>
    <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
      margin-right:0px; -qt-block-indent:0; text-indent:0px;
      -qt-user-state:0;">for i in range(0,number):</p>
    <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
      margin-right:0px; -qt-block-indent:0; text-indent:0px;
      -qt-user-state:0;"> ad.setActivePage(i+1)</p>
    <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
      margin-right:0px; -qt-block-indent:0; text-indent:0px;
      -qt-user-state:0;"> ap = ad.activePage</p>
    <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
      margin-right:0px; -qt-block-indent:0; text-indent:0px;
      -qt-user-state:0;"> items = ap.items</p>
    <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
      margin-right:0px; -qt-block-indent:0; text-indent:0px;
      -qt-user-state:0;"> print " Page", ap.number, "has", len(items),
      "item(s)"</p>
    <p style="-qt-paragraph-type:empty; margin-top:0px;
      margin-bottom:0px; margin-left:0px; margin-right:0px;
      -qt-block-indent:0; text-indent:0px;"><br>
      </code snippet><br>
    </p>
    <p style="-qt-paragraph-type:empty; margin-top:0px;
      margin-bottom:0px; margin-left:0px; margin-right:0px;
      -qt-block-indent:0; text-indent:0px;">I get the following result:
      <meta name="qrichtext" content="1">
    </p>
    <p style="-qt-paragraph-type:empty; margin-top:0px;
      margin-bottom:0px; margin-left:0px; margin-right:0px;
      -qt-block-indent:0; text-indent:0px;">
      <meta http-equiv="Content-Type" content="text/html;
        charset=us-ascii">
      <style type="text/css">
p, li { white-space: pre-wrap; </style><br>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:0;"><!--StartFragment-->****** using pages[]</p>
      Page 5 has 5 item(s)
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:0;"> Page 5 has 5 item(s)</p>
      Page 5 has 5 item(s)
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:0;"> Page 5 has 5 item(s)</p>
      Page 5 has 5 item(s)
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:0;">****** using setActivePage()</p>
      Page 1 has 1 item(s)
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:0;"> Page 2 has 2 item(s)</p>
      Page 3 has 3 item(s)
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:0;"> Page 4 has 4 item(s)</p>
      Page 5 has 5 item(s)
      <p style="-qt-paragraph-type:empty; margin-top:0px;
        margin-bottom:0px; margin-left:0px; margin-right:0px;
        -qt-block-indent:0; text-indent:0px;"><br>
        <!--EndFragment--></p>
      <br>
      <!--EndFragment--></p>
    <meta http-equiv="Content-Type" content="text/html;
      charset=us-ascii">
    <style type="text/css">
p, li { white-space: pre-wrap; }
</style>
    <div class="moz-cite-prefix">On 2012-12-05 04:49, Jain Basil Aliyas
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAOmEOwMCazBXYiu-Q8V9c3Fq3sPLr-YV4ZdunnDFB-a5h8cdnw@mail.gmail.com"
      type="cite">
      <pre wrap="">Hello Mark, ale,

I've added an attribute in document api which will return a list of pages
in a document. You may try out *Scripter.activeDocument.pages* for getting
this.

Regarding the number attribute in page api, I've fixed it as follows:

*page = Scripter.activeDocument.activePage*
*page.number* #this will give the page number.

The setNumber method was actually meant to set the page as active. As you
mentioned, it makes more sense to place it in document api. Hence, I've
moved it there:

*Scripter.activeDocument.setActivePage(2)*

Thanks & Regards,

</pre>
    </blockquote>
  </body>
</html>