NoteWorthy Composer Forum

Forums => Tips & Tricks => User Tools => Topic started by: Rick G. on 2013-01-29 05:38 pm

Title: rg_lyricCopy.vbs - User Tool for Moving Lyrics
Post by: Rick G. on 2013-01-29 05:38 pm
When used on a staff with lyrics, the lyrics will be copied to the Clipboard.
When used on a staff without lyrics, the lyrics in the Clipboard will be added to the staff.

Download to your scripts folder. Use the attached graphic as a guide to naming and setup.
Title: Re: rg_lyricCopy.vbs - User Tool for Moving Lyrics
Post by: Lawrie Pardy on 2013-01-29 10:11 pm
Thanks Rick,
this is another one that will be quite useful to me.
Title: Re: rg_lyricCopy.vbs - User Tool for Moving Lyrics
Post by: Richard Woodroffe on 2013-01-29 11:06 pm
Indeed, Thanks Rick - not particularly necessary for single verse copies, they are just about manageable without too much trouble, but invaluable for multi verses.
Title: Re: rg_lyricCopy.vbs - User Tool for Moving Lyrics
Post by: Rick G. on 2013-01-29 11:49 pm
You are both welcome. I'm finding it useful for copying the lyrics to an editor, tweaking a bit, and copying it back. Transferring lyrics from one song to another is also useful. Some users won't like that it doesn't adjust the staff boundaries, but I see that as a feature.

BTW, this is in VBScript because I haven't figured out how to read and write text to the clipboard with PHP. Reading throws up security prompts asking if I want to allow the script to access the clipboard.
Title: Re: rg_lyricCopy.vbs - User Tool for Moving Lyrics
Post by: Richard Woodroffe on 2013-01-30 08:46 am
I'm finding it useful for copying the lyrics to an editor, tweaking a bit, and copying it back.

Hmmm,  I'm interested in what you are doing here .  When you copy back after tweaking, before running your script, are you first of all setting the lyric line count to <none> so that the script knows that it has to copy back ? If so, I would also find the staff boundaries to be an issue since they are reset.

Maybe you are pasting back without using your script, in which case instruction marks such as "\'s" and "\r\n" do not past back as required and nwctxt items such as "|Lyric4|Text:" are not understood.

Can you just run me through how you are doing this in case I've missed something. Ta.

<edit>Or it occurs that you might be just tweaking your script as appropriate for what you want to do</edit>
Title: Re: rg_lyricCopy.vbs - User Tool for Moving Lyrics
Post by: Rick G. on 2013-01-30 03:59 pm
Hmmm,  I'm interested in what you are doing here .
Usually, I'm dropping a verse or changing the order. Manually restoring the staff boundary isn't a problem for me.

<edit>Or it occurs that you might be just tweaking your script as appropriate for what you want to do</edit>
No, I do that with some unpublished tools, but not this one. If I like the boundaries on the source staff, I just make a mental note of them and put them back in after I change the lyric count to <none>. This is not a tool I use repeatedly on the same song. For a song with many verses, one use can save quite a bit of time.

Maybe you are pasting back without using your script, in which case instruction marks such as "\'s" and "\r\n" do not past back as required and nwctxt items such as "|Lyric4|Text:" are not understood.
No, I'm using the tool. Pasting back into a Lyric textarea would often be more trouble than it is worth.

I do a bit of work with hymns. Quite a few words are capitalized, such as references to the diety. I forget to capitalize them. The tool allows me to search and replace all of them at once instead of moving from verse to verse.
Title: Re: rg_lyricCopy.vbs - User Tool for Moving Lyrics
Post by: Lawrie Pardy on 2013-02-16 09:41 am
Hi Rick,
ran into a problem...  I had a score I was working on and put the lyrics on the wrong staff.  I also had text chords on what would be the source staff as well as some SwingDings characters on another staff.

First time through the tool was fine, but the second run to paste into the correct staff resulted in some of the characters from SwingDings and SwingChord to be changed.  The character affected were all above chr$(127).  This occurred in staves not involved in the "paste" operation.  Characters below chr$(127) seemed to be unaffected.

Can't give you an example from my file because while I was dilligently saving it, it seems my network was having some problems and the file was disappearing into the ether(net).  Anyhow, I'd finished to a point where I thought I could test to make sure I had the details right (which I did), but when I went to revert to my saved version NWC couldn't and I foolishly exited the one I was working on without saving it elsewhere (yeah, I know, stupid...)
Title: Re: rg_lyricCopy.vbs - User Tool for Moving Lyrics
Post by: Rick G. on 2013-02-16 09:57 am
paste into the correct staff resulted in some of the characters from SwingDings and SwingChord to be changed.  The character affected were all above chr$(127).
Thanks, especially for adding:
This occurred in staves not involved in the "paste" operation.
Same thing happened to me with Braces using Windows Symbol font {} (https://forum.noteworthycomposer.com/?topic=8384.0). I'll check it out. I hope that it is not a problem with echoing from stdin to stdout :(
Title: Re: rg_lyricCopy.vbs - User Tool for Moving Lyrics
Post by: Rick G. on 2013-02-16 10:44 am
I hope that it is not a problem with echoing from stdin to stdout :(
It was, but not as big a problem as I feared. I was using WScript.Echo to write back the modified song. WScript.Echo mangles some characters with the high bit set. WScript.StdOut.WriteLine works better. I have replaced version 1.00 with version 1.10 at the top of the page.
Title: Re: rg_lyricCopy.vbs - User Tool for Moving Lyrics
Post by: Lawrie Pardy on 2013-02-17 01:42 pm
Finally got my file rebuilt - tested new version - problem gone - thanks Rick
Title: Re: rg_lyricCopy.vbs - User Tool for Moving Lyrics
Post by: Rick G. on 2013-02-17 07:24 pm
Thanks for confirmation. I now find that if 'Prompts for User Input' is checked,  the script runs much faster. The script doesn't prompt for input, but evidently NWC does something that affects speed when the script tries to run the HTA that 'Class clsClipText' uses to paste (setData).  Go figure ...