View Issue Details

IDProjectCategoryView StatusLast Update
0011230ScribusScripterpublic2013-01-10 21:10
Reportermheieis Assigned To 
Status newResolutionopen 
PlatformallOSallOS Versionall
Product Version1.5.0svn 
Summary0011230: activeDocument.activePage.type returning values
DescriptionThe code documents the following:

in api_page.cpp beginning line 340

 * Scripter.activeDocument.activePage.type
 * Returns 0 if LeftPage, 1 if Middle Page, 2 for Right Page
int PageAPI::type()

However, when invoking Scripter.activeDocument.activePage.type in the console, the logic appears to be reversed, where 0 is the rightPage and 2 is the leftPage.

So not sure if this is a doc or logic issue.
TagsNo tags attached.



2013-01-10 21:10

reporter   ~0029686

Hi Jain,

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?


Using the following in the script console on a 5 page test doc with dummy items on each page:

<code snippet>

ad = Scripter.activeDocument

pages = ad.pages

print "****** using pages[]"

for page in pages :

items = page.items

print " Page", page.number, "has", len(items), "item(s)"

print "****** using setActivePage()"

number = ad.pageCount

for i in range(0,number):


ap = ad.activePage

items = ap.items

print " Page", ap.number, "has", len(items), "item(s)"

</code snippet>

I get the following result:

****** using pages[]
Page 5 has 5 item(s)

Page 5 has 5 item(s)
Page 5 has 5 item(s)

Page 5 has 5 item(s)
Page 5 has 5 item(s)

****** using setActivePage()
Page 1 has 1 item(s)

Page 2 has 2 item(s)
Page 3 has 3 item(s)

Page 4 has 4 item(s)
Page 5 has 5 item(s)

On 2012-12-05 04:49, Jain Basil Aliyas wrote:
> 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,

Issue History

Date Modified Username Field Change
2012-12-03 23:20 mheieis New Issue
2013-01-10 21:10 mheieis Note Added: 0029686