Convert Straight Quotes & Apostrophes to Smart Quotes via FinaleScript™

“Smart”, or curly quotes are in common use in published works of all types, including books, music and even modern web sites. For music scores, these “smart quotes” give a more refined look than the flat or straight quotes do. The difference is subtle, but appreciable.

You can enter these “smart quotes” on the fly in Finale, using the standard keystrokes recognized in Word and many other applications. On Mac, these are Option-[ for the curly start quote and Option-Shift-[ for the curly closing quote.

Presumably, on Windows the corresponding keystrokes are ALT-[ for the curly start quote and ALT-Shift-[ for the curly closing quote.

Sometimes, however, it would be nice to be able to quickly convert all existing quotes and apostrophes in a Finale score in a single operation. And, as it happens…

We can use a Finalescript™ for this.

The basis for this script was originally shared by Finale engraver Howard Begun on the Finale Forum in December of 2011. Here is how it works:

First, the script changes all single quote marks (‘) to curly apostrophes (’). This will allow words that start with an apostrophe (cause, em, etc.) to show with the “curly” variant of the apostrophe, (which is stylistically in keeping with the smart double-quotes).

Next it changes all straight double-quote marks (“) to curly open-quote marks (“).

Next, it searches for any of these open double quotes that are followed by a space, a carriage return, etc. and changes these to curly close-quote marks (”). The original version of the script looks like this:

 



//begin Finalescript
search "'" replace with "’"
search "<34>" replace with "“"
search "“ " replace with "” "
search "“<13>" replace with "”<13>"
search "“-" replace with "”-"
search "“." replace with "”."
search "“)" replace with "”)"
// end Finalescript

 


<34> and <13> are ASCII character codes for the straight double-quote and carriage return respectively. Finalescript™ recognizes character codes for the first 128 ASCII characters in the context of a script like this.

One caveat with Howard’s original version of the script is that it is unable to recognize and convert the final closing quote in Lyrics, Expression or Text Block text. These cases have to be fixed manually.

The solution is to add a search and replace line for every letter of the alphabet followed by a double-quote. The script is now quite a bit longer, and still doesn’t handle  exceptional cases like nested single quotes inside double quotes, but it does address the “final closing quote” scenario.

Finale’s music fonts use the straight double-quote for the Caesura (railroad tracks), so this updated version of the script makes sure that any double quotes in Finale’s music fonts are left as straight quotes.

The updated script looks like this:



//begin Finalescript
process current doc


// change all single quote marks to curly apostrophes
search "'" replace with "’"


// change all straight double-quotes to curly open-quote marks
search "<34>" replace with "“"


// change quotes followed by a space, carriage return etc. to curly close-quote marks (”)
search "“ " replace with "” "
search "“<13>" replace with "”<13>"
search "“-" replace with "”-"
search "“)" replace with "”)"
search "“." replace with "”."
search ".“" replace with ".”"
search "“!" replace with "!”"
search "!“" replace with "!”"
search "“?" replace with "?”"
search "?“" replace with "?”"


//restore caesura character (railroad tracks) if double quote uses the music font
search "“" [Maestro] replace with ""
search "“" [Maestro Wide] replace with ""
search "“" [Jazz] replace with ""
search "“" [Broadway Copyist] replace with ""


//convert to closed double-quote after a final lower case letter
search "a“"replace with "a”", match case
search "b“"replace with "b”", match case
search "c“"replace with "c”", match case
search "d“"replace with "d”", match case
search "e“"replace with "e”", match case
search "f“"replace with "f”", match case
search "g“"replace with "g”", match case
search "h“"replace with "h”", match case
search "i“"replace with "i”", match case
search "j“"replace with "j”", match case
search "k“"replace with "k”", match case
search "l“"replace with "l”", match case
search "m“"replace with "m”", match case
search "n“"replace with "n”", match case
search "o“"replace with "o”", match case
search "p“"replace with "p”", match case
search "q“"replace with "q”", match case
search "r“"replace with "r”", match case
search "s“"replace with "s”", match case
search "t“"replace with "t”", match case
search "u“"replace with "u”", match case
search "v“"replace with "v”", match case
search "w“"replace with "w”", match case
search "x“"replace with "x”", match case
search "y“"replace with "y”", match case
search "z“"replace with "z”", match case


//convert to closed double-quote after a final upper case letter
search "A“"replace with "A”", match case
search "B“"replace with "B”", match case
search "C“"replace with "C”", match case
search "D“"replace with "D”", match case
search "E“"replace with "E”", match case
search "F“"replace with "F”", match case
search "G“"replace with "G”", match case
search "H“"replace with "H”", match case
search "I“"replace with "I”", match case
search "J“"replace with "J”", match case
search "K“"replace with "K”", match case
search "L“"replace with "L”", match case
search "M“"replace with "M”", match case
search "N“"replace with "N”", match case
search "O“"replace with "O”", match case
search "P“"replace with "P”", match case
search "Q“"replace with "Q”", match case
search "R“"replace with "R”", match case
search "S“"replace with "S”", match case
search "T“"replace with "T”", match case
search "U“"replace with "U”", match case
search "V“"replace with "V”", match case
search "W“"replace with "W”", match case
search "X“"replace with "X”", match case
search "Y“"replace with "Y”", match case
search "Z“"replace with "Z”", match case


//convert to closed double-quote after final a lower case international character
search "à“"replace with "à”", match case
search "á“"replace with "á”", match case
search "ä“"replace with "ä”", match case
search "â“"replace with "â”", match case
search "ç“"replace with "ç”", match case
search "è“"replace with "è”", match case
search "é“"replace with "é”", match case
search "ë“"replace with "ë”", match case
search "ê“"replace with "ê”", match case
search "ì“"replace with "ì”", match case
search "í“"replace with "í”", match case
search "ï“"replace with "ï”", match case
search "î“"replace with "î”", match case
search "ò“"replace with "ò”", match case
search "ó“"replace with "ó”", match case
search "ö“"replace with "ö”", match case
search "ô“"replace with "ô”", match case
search "ù“"replace with "ù”", match case
search "ú“"replace with "ú”", match case
search "ü“"replace with "ü”", match case
search "û“"replace with "û”", match case


//convert to closed double-quote after a final upper case international character
search "À“"replace with "À”", match case
search "Á“"replace with "Á”", match case
search "Ç“"replace with "Ç”", match case
search "È“"replace with "È”", match case
search "É“"replace with "É”", match case
search "Ì“"replace with "Ì”", match case
search "Í“"replace with "Í”", match case
search "Ò“"replace with "Ò”", match case
search "Ó“"replace with "Ó”", match case
search "Ù“"replace with "Ù”", match case
search "Ú“"replace with "Ú”", match case
search "Ü“"replace with "Ü”", match case
search "Û“"replace with "Û”", match case


// end Finalescript


Download the script here.

You should see two text files in the directory.  Once in the directory, right-click on the file you want to use and download it to your desktop. One is the actual Finalescript™ file, which you can drop into your Finalescript folder on your hard drive, or if you aren’t sure where that folder resides, the other file is a text file that you can copy the script text from and paste into a new Finalescript.

I recommend you use one of these linked files for your source rather than copying text from this page – WordPress seems to like to change straight quotes into curly quotes on the fly, which doesn’t work so well with this script, as you can imagine!

On the off-chance that you want to convert in the other direction – changing smart quotes to straight quotes, the script is very simple, and in fact, is already found in the “Simple Scripts” folder of the Finalescript palette. It looks like this:



//Start Finalescript - Double quotes
search "“" replace with "<34>"
search "”" replace with "<34>"


//Single quotes
search "‘" replace with "<39>"
search "’" replace with "<39>"
//End Finalescript


<34> and <39> are ASCII character codes for the straight double-quote and straight apostrophe respectively.

That’s it! Enhance the look of your Finale scores with Smart Quotes.

~robert

Thanks to Howard Begun for his help proofreading the modified version of the script, and for the additional script lines to insure that double-quotes appearing in one of Finale’s music fonts are left alone. Thanks also to Philip Rothman for pointing me to the original Finale Forum discussion.

One Reply to “Convert Straight Quotes & Apostrophes to Smart Quotes via FinaleScript™”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.