The original version of this page can be found at : http://forum.makemusic.com/default.aspx?f=12&m=339423
Posted By : rbeavers - 8/20/2011 10:00 PM
Hi,

I'm using Finale 2011 (Mac), and attempting to write a script that combs through a score and changes all the instrument names and abbreviations. I created this score by pulling in parts using Score Merger; it works pretty well, but for some reason, it doesn't pull in all instrument names...only about half of them. So my goal is to wipe out any existing names (if applicable) and replace them.

Here's the script:


Staff tool

// Reed 1
select stave 1
menu item "Staff/Edit Staff Attributes..."
press "edit" near "Full Name"
clear all 
type raw " reed 1"
button "ok"
wait 1 second
press "edit" near "Abbr. Name"
clear all
type raw " rd. 1"
button "ok"
button "ok"


I'm having two issues with this script:

1. For some mac-related reason which I don't quite understand, I have to use 'type raw' instead of 'type' (which ends up inserting nothing). This works, but instead of 'Reed 1'/'Rd. 1' being inserted, I get 'REed 1'/RD. 1'. Does anyone know why this would happen, and how to fix it?

2. When there *is* an existing name, I want to erase it before inserting a different instrument name - or else I end up with two names. I've tried many variations - Select all, Triple click, Clear all (used in the script above) - and none of them work. In fact, it causes the script to go into some strange loop, where the names are continuously pushed down, as if I were inserting a carriage return. Any ideas?

Thanks,
Ryan

Posted By : James L - 8/21/2011 8:47 PM
I played around a bit and I'm also getting the first issue that you've listed. I even tried a hack by writing:

type raw "R"
type raw "eed 1"

and it still produced REed 1. So I'm at a loss there. sad

As for the second issue. If you select all the text and then delete it, you can avoid that loop issue. i.e.:

Staff tool
// Reed 1
select stave 1
menu item "Staff/Edit Staff Attributes..."
press "edit" near "Full Name"
press command + "A"
delete key

type raw "Reed 1"
button "ok"
wait 1 second
press "edit" near "Abbr. Name"
press command + "A"
delete key

type raw "Rd. 1"
button "ok"
button "ok"


Finale 2000, 2004-2011c.r1
Dual 2.0GHz Power PC G5, 3.5GB RAM, OS 10.4.11
MacBook Pro, 2.8GHz, 4GB RAM, OS 10.6.6
Sibelius 5.0-6.1


Posted By : James L - 8/21/2011 10:18 PM
ok, so here's a fiddly workaround for the first issue. :p

It seems that the Finalescript has a sticky "shift" key when it types the name in. I even tried capitalising the whole name, as a test, and instead of REED 1, it wrote REED !. The exclamation mark is surely a sign that it's somehow holding down the shift key for too long.

So below is my clunky workaround. The problem is that this workaround going to make your script rather long if every instrument name needs three lines of script.

Anyway, this worked on my system. I'd be keen to hear of any other possible workarounds that might be neater.


Staff tool

// Reed 1
select stave 1
menu item "Staff/Edit Staff Attributes..."
press "edit" near "Full Name"
press command + "A"
delete key
type raw "R"
press shift
type raw "eed 1"

button "ok"
wait 1 second
press "edit" near "Abbr. Name"
press command + "A"
delete key
type raw "R"
press shift
type raw "d. 1"

button "ok"
button "ok"


Finale 2000, 2004-2011c.r1
Dual 2.0GHz Power PC G5, 3.5GB RAM, OS 10.4.11
MacBook Pro, 2.8GHz, 4GB RAM, OS 10.6.8
Sibelius 5.0-6.2


Posted By : rbeavers - 8/22/2011 7:26 AM
Wow...thanks! That 'press command + "A" ' line did the trick. I wish Finale would come up with a definitive list of what commands work when and where. That would be very helpful. Too many combinations to choose from, and it's never certain which ones are the right ones.

I actually came up with a different workaround for the capitalization - adding a 'search and replace' at the end of the block:

search "reed 1" replace "Reed 1"
search "rd. 1" replace "Rd. 1"


This works fine, but I think I'm going to use yours, just in case there happens to be text somewhere else in the score that uses an instrument name.

Posted By : KennethKen - 8/24/2011 7:58 AM
rbeavers said...
I actually came up with a different workaround for the capitalization - adding a 'search and replace' at the end of the block:

search "reed 1" replace "Reed 1"
search "rd. 1" replace "Rd. 1"
A benefit of this approach is that it will catch any cue names that have been entered using the Expression tool.
 
Ken


Windows 7 Pro (64 bit), Finale 2011, Core i7 920@2.67Ghz, 6GB Ram
Brass music, Woodwind Music, Concert Band Music, CDs, etc.