NoteWorthy Composer Forum

Forums => General Discussion => Topic started by: Lawrie Pardy on 2016-01-23 09:29 am

Title: PageTxt.nw object
Post by: Lawrie Pardy on 2016-01-23 09:29 am
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.
Title: Re: PageTxt.nw object
Post by: Rick G. on 2016-01-23 07:07 pm
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()
Title: Re: PageTxt.nw object
Post by: NoteWorthy Online on 2016-01-23 07:16 pm
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.
Title: Re: PageTxt.nw object
Post by: Lawrie Pardy on 2016-01-24 01:01 am
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 :)
Title: Re: PageTxt.nw object
Post by: Mike Shawaluk on 2016-01-24 01:22 am
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
Title: Re: PageTxt.nw object
Post by: Rick G. on 2016-01-24 01:37 am
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
Title: Re: PageTxt.nw object
Post by: Lawrie Pardy on 2016-01-24 01:49 am
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. :-[  :-[