Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently September 30th, 2024, 9:29 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Auto Page numbering
PostPosted: March 28th, 2005, 2:08 pm 
Offline

Joined: March 28th, 2005, 2:05 pm
Posts: 15
Hi
I'm using a master page followed by about 30 other pages. Does anyone know a method of incrementing and displaying page numbers please?

Thanks

_________________
kind regards
Aidan


For this message Aidan has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Page Numbers
PostPosted: March 29th, 2005, 1:20 am 
Offline

Joined: October 25th, 2004, 2:20 pm
Posts: 686
Location: Naperville, Illinois (USA)
Opus: 7.05
OS: Win XP SP3
System: P4 3.2GHz 1GB RAM 2-TB HDs + 4 more
Aiden --

On your Master Page, create a Text Object, then right click on the object and select Insert a Variable. You'll need to create a new variable, let's call it "Number" which you should make a number instead of text.

Now create a Forward Button Object and a Previous Button Object. For the Actions on the Forward Button start with Programming - Variable - Add. The default is add "1" which is what we want. Go to the lower selection window and for the Variable use the drop-down selector and pick "Number." The next Action is Go To Page - Forward.

For the Previous Button, select Subtract, and again select the Number variable we created first; then add the Go to Page Back (not "Previous").

If your presentation only goes forward and backward -- you're done. If you have a selection menu, then you will need to do a Variable Set before your Go To Page xx.

Hope that helps.

_________________
Fred Harms, Extraordinary Demos
Naperville, Illinois (USA) 630/904-3636
demofred@aol.com


For this message demofred has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: March 29th, 2005, 1:29 am 
Offline

Joined: October 26th, 2004, 1:26 pm
Posts: 262
I see Fred beat me to the reply and as always, came up with a good solution.:D However I prepared this reply offline and it is an alternative so will paste the reply here....


Hi Aidan,

Do you have Opus Pro? If so, you can use the script GetPageNumber() on each page associated to the Master Page.

Have an On-Show action on the page plus a text box with an inserted variable e.g. <PageName>

The code for the script action would then be:
PageName = GetPageNumber()

// this will result in an incremental page number. :)

_________________
Cheers,
Steve


For this message Steve H has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Auto Page numbering
PostPosted: July 29th, 2011, 9:36 pm 
Offline

Joined: May 25th, 2005, 10:40 am
Posts: 17
Opus: Opus Pro 7
OS: Windows 7 - macOS Lion
System: imac
my problem is (using GetPageNumber()) that the number increases by 1 even if your publication is split into chapters.

i want to ger the PageNumber into a chapter and not into a whole publication.

Do you have a solution about this?


For this message tempo has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Auto Page numbering
PostPosted: July 31st, 2011, 12:07 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Quote:
i want to ger [get] the PageNumber into [within] a chapter and not into a whole publication.
It is easy to do, but it would help to know more about how you are approaching this, ...and how you intend to use the information.

something like the following expression may achieve it, but there are better or more simple ways -- if I knew how and where you were triggering the script. I will ASSUME you will run the script using a Page OnShow().
Code:
var numpagesinChap = this.GetParent().GetNumberChildren() ;
var currpageNum = "" ;

for (i=0; i<5; i++)
{
var testname = this.GetName().toString() ;
var testchild = this.GetParent().GetChild(i).GetName() ;
Debug.trace( "test child:\t" +testchild  +"\n")
   if ( testname  == testchild )
  {
  currpageNum = i +1 ;
  }
}
Debug.trace( "show current page Number:\t" + currpageNum +"\n")



CAVEAT: Now my understanding is that this should NOT work!! Help/Review needed from others.
Help files say that when Opus provides a result using GetChild(somenumber), the first child [i.e. child zero] is supposed to be the bottom one in the Organizer view. This is true for objects lower than page level.

But it does not seem to be true for 'children' of a Chapter object. Can anybody confirm why this occurs?


Anyway tempo,
You should be able to paste the above code in a Script Object and it will run. I will leave it to you to use the data shown in Debug.trace pane and apply it to your own variables or other expressions.

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Last edited by Lar_123 on July 31st, 2011, 5:24 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Auto Page numbering
PostPosted: July 31st, 2011, 12:23 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
tempo,

I should add that the script needs to be placed on every page that you want to 'self-report' the page number (within Chapter).
An easy way to achieve this is to create an Opus Master Page. Place that script only on the Master Page, and then have every regular Page use that Master Page. The script gets pulled in and used properly.

Tip: in case you did not know, any Page can have multiple Master Pages (accomplished by cascading one MP onto another).

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


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: No registered users and 3 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group