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 can not replicate this. For:
!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:
!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:
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
I am still using adp_GlobalMod.php version 2.1
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 have updated my User Tool Starter Kit to 2.75
I am now seeing what you are seeing.
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.
Thanks Rick. That's a good workaround.
Thanks for the report. The problem seems to be caused by the base starter kit framework. Will update this when I know more.
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.
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 pushed another update (https://github.com/nwsw/nwc2utsk/commit/e645777060b60772f9bd998aedfed1c9118751d2) that should fix the encoding problems with quote characters.
The latest update causes some new issues. For example, a MPC that uses Linear Sweep is broken by the update. Still working on it.
Here is yet another fixed version (https://github.com/nwsw/nwc2utsk/commit/a7aa3ab410b11e072b1bc0f408a78aff67ac2205) of the file.
New installer (https://noteworthycomposer.com/nwc2/usertools/) has been published.
Hi Eric,
my initial testing looks good, of course, I haven't been exhaustive but what I have done has been OK.
Thank you
The starter kit install program has been updated to correct this problem.
https://noteworthycomposer.com/nwc2/usertools/