Skip to main content
Topic: PageTxt.nw object (Read 4533 times) previous topic - next topic

PageTxt.nw object

Hi Eric,
I have a couple of suggestions for possible enhancement of the PageTxt.nw object:

a) could the object be modified to have an additional variable available that permits printing the total number of pages?  Is this data even available?  Surely it would be at print time...

What I'm aiming for with this is to be able to set the object with the "Text" of:
%Title% - %StaffLabel% - Page %PageNum,1%/%TotalPages%
(Italics to indicate proposed new variable.) which would allow the printing of "Page x/y" or perhaps "Page x of y"

b) can the object be modified to optionally NOT print on the 1st page.  I know I can achieve the same result by putting the object somwhere on the second page instead of the first, but it is easier to position the objects at the start of each staff instead of having to figure out where the second page starts for each instrument.
I plays 'Bones, crumpets, coronets, floosgals, youfonymums 'n tubies.

Re: PageTxt.nw object

Reply #1
a) could the object be modified to have an additional variable available that permits printing the total number of pages?  Is this data even available?  Surely it would be at print time...
I agree that it would be useful to have an API function to return the number of pages. It might be as simple as returning two values from: nwcdraw.getPageCounter()
Registered user since 1996

Re: PageTxt.nw object

Reply #2
NWC does not currently precalculate page counts, so it does not actually know this. You could get close to this using a File Info variable, which you could update as needed when the page count changes.

Code: [Select · Download]
%Comment,TotalPages%

You can start a PageTxt in the second bar. This makes it skip the first page.

Re: PageTxt.nw object

Reply #3
NWC does not currently precalculate page counts, so it does not actually know this. You could get close to this using a File Info variable, which you could update as needed when the page count changes.

Code: [Select · Download]
%Comment,TotalPages%
I'm sorry Eric, I just haven't figured out the syntax.  How do I define the variable in the Comments area?

I tried things like:
TotalPages=2
TotalPages 2
%TotalPages%=2
TotalPages,2
TotalPages==2
TotalPages="2"
TotalPages "2"
%TotalPages%="2"
TotalPages,"2"
TotalPages=="2"


You can start a PageTxt in the second bar. This makes it skip the first page.
Ah, didn't realise that - second bar is fine :)
I plays 'Bones, crumpets, coronets, floosgals, youfonymums 'n tubies.

Re: PageTxt.nw object

Reply #4
I'm sorry Eric, I just haven't figured out the syntax.  How do I define the variable in the Comments area?

I tried things like:
TotalPages=2
TotalPages 2
%TotalPages%=2
TotalPages,2
TotalPages==2
TotalPages="2"
TotalPages "2"
%TotalPages%="2"
TotalPages,"2"
TotalPages=="2"

The sample score PageTxtMaestro.nwc gives an example of how to do this. If you use %Comment,TotalPages% in your PageTxt object, you would put the following somewhere in the score comments box:

TotalPages: 5

(of course, substitute the correct value)

Mike

Re: PageTxt.nw object

Reply #5
Code: (nwc) [Select · Download]
!NoteWorthyComposer(2.75)
|SongInfo|Comments:"PageTotal:3"
|AddStaff|Name:"Staff"
|StaffProperties|EndingBar:Open (hidden)
|User|PageTxtMaestro.nw|Pos:10|Class:StaffSig
|Rest|Dur:Whole
|Bar
|User|PageTxt.nw|Pos:8|PgStyle:PageNumber|Text:"Page %PageNum,1% of %Comment,PageTotal%"|Fnt:PageSmallText|YLoc:Top|XLoc:Right
|Rest|Dur:Whole
|Bar
|Boundary|Style:NewSystem|NewPage:Y
|Rest|Dur:Whole
|Bar
|Boundary|Style:NewSystem|NewPage:Y
|Rest|Dur:Whole
|Bar
|Boundary|Style:NewSystem|NewPage:Y
!NoteWorthyComposer-End
Registered user since 1996

Re: PageTxt.nw object

Reply #6
Thanks Rick and Mike.

The sample score PageTxtMaestro.nwc gives an example of how to do this. If you use %Comment,TotalPages% in your PageTxt object, you would put the following somewhere in the score comments box:

TotalPages: 5

(of course, substitute the correct value)

Mike
D'oh... I should have thought to try that label type.
I did check the PageTextMaestro thread but didn't think to actually look into the example NWC file. :-[  :-[
I plays 'Bones, crumpets, coronets, floosgals, youfonymums 'n tubies.