Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 11:08 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Number of Pages in Chapter
PostPosted: August 1st, 2006, 8:43 am 
Offline

Joined: November 22nd, 2004, 7:26 pm
Posts: 119
Location: Austria
Is there any way that I can get the number of pages that a certain chapter has into a variable and display it , for example:

Chapter 2 has 8 pages and I wouldlike to have a textbox with a variable inside which displays the current page and the number of pages in the chapter : like 3 of 6

The GetPageNumber function only works for the whole pub . Is there a workaround :?

_________________
Klaus Rosmanitz
Austria


________
XP Home , Opus Pro 5.5


Top
 Profile  
 
 Post subject:
PostPosted: August 1st, 2006, 10:04 am 
Offline

Joined: October 26th, 2004, 10:23 am
Posts: 666
Location: Digital Workshop
You can do this with a little scripting:
Code:
var NumPagesInChapter = this.GetPage().GetParent().GetNumberChildren();

_________________
ddww Opus Developer


Top
 Profile Visit website  
 
 Post subject:
PostPosted: August 1st, 2006, 10:06 am 
Offline

Joined: November 22nd, 2004, 7:26 pm
Posts: 119
Location: Austria
:D ThanKs for your quick reply Duncan, I'll try it out !

_________________
Klaus Rosmanitz
Austria


________
XP Home , Opus Pro 5.5


Top
 Profile  
 
 Post subject:
PostPosted: August 1st, 2006, 10:28 am 
Offline

Joined: November 22nd, 2004, 7:26 pm
Posts: 119
Location: Austria
Duncan Lilly wrote:
You can do this with a little scripting:
Code:
var NumPagesInChapter = this.GetPage().GetParent().GetNumberChildren();


Tried it out but it won't work that way . I always get "Function not found : Check capitalization or spelling".

Found out though if you leave out the GetPage() function it works , so the correct code would be var NumPagesInChapter = this.GetParent().GetNumberChildren();

Thanks for your great help anyway :D

_________________
Klaus Rosmanitz
Austria


________
XP Home , Opus Pro 5.5


Top
 Profile  
 
 Post subject:
PostPosted: August 1st, 2006, 11:00 am 
Offline

Joined: October 26th, 2004, 10:23 am
Posts: 666
Location: Digital Workshop
Should have mentioned it will depend on the object the script is in:

For a script object on a page you would use:
Code:
var NumPagesInChapter = this.GetParent().GetNumberChildren();

For a script action or script object inside any other object:
Code:
var NumPagesInChapter = this.GetPage().GetParent().GetNumberChildren();

Basically you need to get the parent of the current page (i.e. the chapter); so looking at the tree should tell you what you need to call.

_________________
ddww Opus Developer


Top
 Profile Visit website  
 
 Post subject:
PostPosted: August 1st, 2006, 1:18 pm 
Offline

Joined: November 22nd, 2004, 7:26 pm
Posts: 119
Location: Austria
Sorry , my fault !

_________________
Klaus Rosmanitz
Austria


________
XP Home , Opus Pro 5.5


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Majestic-12 [Bot] and 46 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group