Skip to main content
Topic: GlobalMod Issue with PageTxtMaestro (Read 9292 times) previous topic - next topic - Topic derived from PageTxtMaestro.nw

GlobalMod Issue with PageTxtMaestro

Hey Eric,
I've been using these objects quite a bit lately and I LOVE 'em :D  You have a very happy boy here.

BUT (you just knew there was gonna be one didn't you?) I've discovered that the contents of the "Text" field of the PageTxt.nw gets corrupted by Global_Mod.

E.G. I have a template that has this object on every staff.  The contents of the Text field are:
%Title% - %StaffLabel% - Page %PageNum,1%

As you know, I'm a big user of Global_Mod, and it seems each time I run Global_Mod on a staff the contents of the Text field of PageTxt.nw objects gets a double quote or apparently escaped characters added at each end so this:
%Title% - %StaffLabel% - Page %PageNum,1%
becomes this (changes in red to stand out):
"%Title% - %StaffLabel% - Page %PageNum,1%"
then the next time I run a Global_Mod command I get this:
"\"%Title% - %StaffLabel% - Page %PageNum,1%\""
then this:
"\"\]\"%Title% - %StaffLabel% - Page %PageNum,1%\]\"\""
then this:
"\"\]\"\]]\]\"%Title% - %StaffLabel% - Page %PageNum,1%\]]\]\"\]\"\""
and so on.

If I use it on one staff it only affects the PageTxt.nw object on that staff, if I use it in file mode it affects all of them, as you would expect. 

I haven't spotted it happening to any other object, but would I be going out on a limb here to suggest that perhaps Global_Mod needs an update?

To generate this example the Global_Mod command I used was:
Tempo,Tempo==180 Visibility=TopStaff

NB, there were no Tempo marks in the test file, but I discovered the corruption in a file that had 2 on each staff.

I just perfromed a second test with the Global_Mod command:
Text,Font==User6 Pos+=2
and got the same result.
I plays 'Bones, crumpets, coronets, floosgals, youfonymums 'n tubies.

Re: GlobalMod Issue with PageTxtMaestro

Reply #1
I have a template that has this object on every staff.  The contents of the Text field are:
%Title% - %StaffLabel% - Page %PageNum,1%

As you know, I'm a big user of Global_Mod, and it seems each time I run Global_Mod on a staff the contents of the Text field of PageTxt.nw objects gets a double quote or apparently escaped characters added at each end so this:
%Title% - %StaffLabel% - Page %PageNum,1%
becomes this (changes in red to stand out):
"%Title% - %StaffLabel% - Page %PageNum,1%"
then the next time I run a Global_Mod command I get this:
"\"%Title% - %StaffLabel% - Page %PageNum,1%\""
then this:
"\"\]\"%Title% - %StaffLabel% - Page %PageNum,1%\]\"\""
then this:
"\"\]\"\]]\]\"%Title% - %StaffLabel% - Page %PageNum,1%\]]\]\"\]\"\""
and so on.
I can not replicate this. For:
Code: (nwc) [Select · Download]
!NoteWorthyComposer(2.75)
|SongInfo|Title:"The Title"
|AddStaff|Name:"Staff"|Label:"The Label"
|User|PageTxtMaestro.nw|Pos:0|Class:StaffSig
|User|PageTxt.nw|Pos:7|Text:"%Title% - %StaffLabel% - Page %PageNum,1%"|XLoc:Left|YLoc:Top|PgStyle:TopLeft
|Rest|Dur:Whole
!NoteWorthyComposer-End
I can repeatedly run Golbal Mod without problem. But if I change the PageText item to:
Code: (nwc) [Select · Download]
!NoteWorthyComposerClip(2.75,Single)
|User|PageTxt.nw|Pos:7|Text:"\"%Title% - %StaffLabel% - Page %PageNum,1%"|XLoc:Left|YLoc:Top|PgStyle:TopLeft
!NoteWorthyComposerClip-End
I get the cumulative backslash bug that you describe.

If you are looking for a near term solution, it would be to stop using quote(s) in the Text field. They are seldom needed and there are other characters you can use instead.
Registered user since 1996

Re: GlobalMod Issue with PageTxtMaestro

Reply #2
I can not replicate this. For:
Code: (nwc) [Select · Download]
!NoteWorthyComposer(2.75)
|SongInfo|Title:"The Title"
|AddStaff|Name:"Staff"|Label:"The Label"
|User|PageTxtMaestro.nw|Pos:0|Class:StaffSig
|User|PageTxt.nw|Pos:7|Text:"%Title% - %StaffLabel% - Page %PageNum,1%"|XLoc:Left|YLoc:Top|PgStyle:TopLeft
|Rest|Dur:Whole
!NoteWorthyComposer-End
I can repeeatedly run Golbal Mod without problem. But if I change the PageText item to:
Code: (nwc) [Select · Download]
!NoteWorthyComposerClip(2.75,Single)
|User|PageTxt.nw|Pos:7|Text:"\"%Title% - %StaffLabel% - Page %PageNum,1%"|XLoc:Left|YLoc:Top|PgStyle:TopLeft
!NoteWorthyComposerClip-End
I get the cumulative backslash bug that you describe.

If you are looking for a near term solution, it would be to stop using quote(s) in the Text field. They are seldom needed and there are other characters you can use instead.
Hi Rick,
thanks for looking at this for me.  Please note that I don't use quotes in the Text field.  I get the problem with the exact content I prescribed:
%Title% - %StaffLabel% - Page %PageNum,1%

I copied and pasted as a new file your first example.  Initial content of the PageTxt.nw Text field was:
%Title% - %StaffLabel% - Page %PageNum,1%
I ran Global_Mod with:
Text,Font==User6 Pos+=2
and got:
"%Title% - %StaffLabel% - Page %PageNum,1%"
Note the quotes that have been added.  Next run changed to this:
"\"%Title% - %StaffLabel% - Page %PageNum,1%\""
Third run:
"\"\]\"%Title% - %StaffLabel% - Page %PageNum,1%\]\"\""
Fourth run:
"\"\]\"\]]\]\"%Title% - %StaffLabel% - Page %PageNum,1%\]]\]\"\]\"\""

You can see the effect is cumulative.

Version information in my copy of Global_Mod:
Quote
// G L O B A L _ M O D . P H P
//
// Author: Copyright (c)2004 Andrew Purdam (ADP)
//
//
//   Date      Ver   Who   Comments
//    9/11/04   1.0   ADP   1st release
//   17/11/04 1.0.1 ADP   Added help msg
//  2/12/04 1.0.2 ADP   Added message for empty selection
//  11/3/05 1.1 ADP Added a "negative" (using '!')
//  2006-08-11 1.2 nwsw Added support for escaping commas in the "<comparison>" section, small code clean up
//  2009-10-11 1.5 nwsw Clean up PHP5 warnings
//  2010-07-14 2.0 nwsw Support usage against entire file text
//  2011-12-19 2.1 nwsw Support most nwctxt objects
//  2015-09-15 2.75 nwsw Support User.<objtype> expression for <type>
//
// For documentation, see help_msg_and_exit (down a few lines)
I plays 'Bones, crumpets, coronets, floosgals, youfonymums 'n tubies.

Re: GlobalMod Issue with PageTxtMaestro

Reply #3
I am observing the same results as Lawrie for Rick's sample clip. Initially, the value of the parameter in the NWCTXT is surrounded by quotes, but when viewing the custom object properties, the text is not surrounded by quotes (both of these as are expected). After running the user tool, the text is now surrounded by double quote characters in the custom object property box, and it is surrounded by escaped quotes in the NWCTXT. I did not try running the tool multiple times, but I would expect the repeated escaping to take place as described.

I am running the same version of adp_GlobalMod.php as Lawrie is using.

Mike

Re: GlobalMod Issue with PageTxtMaestro

Reply #4
I am running the same version of adp_GlobalMod.php as Lawrie is using.
I am still using adp_GlobalMod.php version 2.1
Registered user since 1996

Re: GlobalMod Issue with PageTxtMaestro

Reply #5
Thanks Mike and Rick.  The version difference makes your results more understandable Rick.

Hopefully Eric will know what's wrong and be able to update adp_GlobalMod.php fairly soon.
I plays 'Bones, crumpets, coronets, floosgals, youfonymums 'n tubies.

Re: GlobalMod Issue with PageTxtMaestro

Reply #6
The version difference makes your results more understandable Rick.
I have updated my User Tool Starter Kit to 2.75
I am now seeing what you are seeing.

Hopefully Eric will know what's wrong and be able to update adp_GlobalMod.php fairly soon.
In the meantime, you can replace your spaces with no-break spaces.
Hardly an ideal solution. I can't post a clip of it. Somewhere along the way, the no-break spaces get removed, but the attachment seems to work.
Registered user since 1996

Re: GlobalMod Issue with PageTxtMaestro

Reply #7
Thanks Rick.  That's a good workaround.
I plays 'Bones, crumpets, coronets, floosgals, youfonymums 'n tubies.

Re: GlobalMod Issue with PageTxtMaestro

Reply #8
Thanks for the report. The problem seems to be caused by the base starter kit framework. Will update this when I know more.

Re: GlobalMod Issue with PageTxtMaestro

Reply #9
Replace your existing lib/obj_NWC2ClipItem.inc file with the attached version. This should fix it.

This will be bundled into an updated starter kit release soon.

Update: Based on feedback, a new fix has been attached that corrects some encoding issues with quote characters.

Update 2: Withdrawn....see later replies.

Re: GlobalMod Issue with PageTxtMaestro

Reply #10
Hey Eric,
thanks buddy.  Works just right provided there aren't any quotes in the field already, but if the field contains any quotes they still get "escaped" but now only with backslashes:
start with %Title% - %StaffLabel% - Page %PageNum,1% and nothing changes, BUT start with:
"%Title% - %StaffLabel% - Page %PageNum,1%" - run Global_Mod and get
\"%Title% - %StaffLabel% - Page %PageNum,1%\" - run it again and get
\\"%Title% - %StaffLabel% - Page %PageNum,1%\\" - each subsequent run adds another backslash.

<putting on best "Maxwell Smart" voice> "Missed, by that much".  :D
I plays 'Bones, crumpets, coronets, floosgals, youfonymums 'n tubies.

Re: GlobalMod Issue with PageTxtMaestro

Reply #11
I pushed another update that should fix the encoding problems with quote characters.

Re: GlobalMod Issue with PageTxtMaestro

Reply #12
The latest update causes some new issues. For example, a MPC that uses Linear Sweep is broken by the update. Still working on it.

Re: GlobalMod Issue with PageTxtMaestro

Reply #13
Here is yet another fixed version of the file.

New installer has been published.

Re: GlobalMod Issue with PageTxtMaestro

Reply #14
Hi Eric,
my initial testing looks good, of course, I haven't been exhaustive but what I have done has been OK.

Thank you
I plays 'Bones, crumpets, coronets, floosgals, youfonymums 'n tubies.