The original version of this page can be found at :
Posted By : Graeme Gilmore - 4/29/2004 7:36 AM
Search and Replace problem (Finale version 2004b.r1)
I am working on a script to replace the apostrophe and quotes to the curly forms.
The following will change a straight apostrophe to a curly one
search “'” replace “’” — with the curly apostrophe entered by typing the ASCII character, ALT 0146, directly in the Finale Script Editor.
The problem comes when I export the script to Word and then import it back into Finale. All the curly quotes and apostrophes in Word are converted back to the plain variety in Finale, a long-standing situation.
To allow me to edit the script in Word, I thought I would substitute the ASCII code for the curly apostrophe (ASCII 0146), but that doesn’t seem to work. I cannot get Search and Replace to accept the following command
search ”'” replace <0146>
I also tried "<0146>" and "^<0146>" and ^<0146> without success
Am I writing the code incorrectly?
Thanks for the help. 

Finale 2004b.r1, Windows XP, TGTools

Post Edited (Graeme Gilmore) : 4/29/2004 11:39:28 AM GMT

Posted By : Peter Thomsen - 4/29/2004 8:25 AM
My guess is that you should take a good look at Word's preferences.

You might find an option about automatic substitution of quotes.

Alternatively you could try another word processor than Word.

I suppose that even the smallest, simplest word processor can handle scripting code.


Posted By : Michael Johnson - 5/5/2004 2:37 PM
Hi Graeme --

I agree with Peter. The problem stems from the MS Word auto-formatting of Smart Quotes. For me, in Word going Format menu >> Auto Format... Options, there is a check box for smart Quotes. You could try NotePad or TextPad as text editing tools to use instead of Word.


Michael Johnson
QA Supervisor

Posted By : Graeme Gilmore - 5/5/2004 10:16 PM
Yes, I agree with what you say. What I was trying to achieve, though, was a search or replace instruction that was immune to the problem. That led me to try to search and replace actual ASCII codes. They are listed as one of the <> options, but I haven’t see any particular way FinaleScript planned to use them. I was pushing the limits, trying to use them in Search and Replace.
Presumably, since no one has suggested how to do it, I cannot use ASCII codes in the way I was trying and the problem was not that I just didn't know how to go about it.
By the way, I tried copying a curly apostrophe created in Finale into Word (it stayed curly). But copying it from Word (no changes, just immediately highlight and copy) back into Finale did not work. The curly apostrophe reverted to a straight apostrophe. So turning off curly quotes makes no real difference.
Thanks for the information

Finale 2004b.r1, Windows XP, TGTools

Posted By : Michael Johnson - 5/7/2004 9:54 AM
Hi Graeme --
I apologize for misunderstanding your question. Yes, you could create a little script to just convert the characters. Unfortunately, I have found that there is a problem in the FS plug-in on Windows. I have documented the issue. The Search and Replace of ASCII Characters functionality does not work in FinaleScript. As a temporary solution on Win, you can use the Text Search and Replace plug-in in Finale 2004 to find smart quotes (0147 and 0148) and replace with straight quotes (34)
To do this:
Bring up the TSAR plug-on
For the front side quote:
in Search field hold down Alt and type 0147 on the Numpad (or paste in the character from the clipboard)
FYI: on Mac the keystroke is Option+[
in Replace field Shift+'
For the back side quote:
in Search field hold down Alt and type 0148 on the Numpad (or paste in the character from the clipboard)
FYI: On Mac the keystroke is Option+Shift+[
in Replace field Shift+'
This worked for me and I would be interested if it didn't work for you.
The FS syntax to make ASCII character replacement work is as follows. Because Smart quotes are in different slots on Mac and Win, I will show both scripts. Again, this won't work on Windows. I apologize for that and have documented the issue.
//start Mac Script
process open doc
search "<210>" replace "<34>"
search "<211>" replace "<34>"
//end Mac Script

//Start Win Script
process open doc
search "<147>" replace "<34>"
search "<148>" replace "<34>"
//end Win Script
Thanks for your interest in FinaleScript,

Michael Johnson
QA Supervisor

Posted By : Graeme Gilmore - 5/8/2004 10:31 PM
Thanks for the information. However, what I want to do is to take straight quotes and apostrophe's and convert them to curly. However, when I tried that there were several problems.
Sorry, the rest of this entry is hard to follow because I can't use quotes to help clarify quoted text since they are the focus of the discussion. Basically, when I searched on a symbol (e.g., ') and replaced it using as ASCII character as described in Michael Johnson's entry yesterday, TSAR throws in a character not part of the Times New Roman Font (displayed as a square)
My test phrase -- including the quotes -- was the lyric "This is O'Hara."
After using TSAR search ", replace <146> [Win curly apostrophe]
In the Edit Lyrics window it showed "This is O’Hara.” However, the lyric under the music showed "This is O’
The curly apostrophe was there but the Hara." was no longer visible.
Then I set the phrase up again as at the beginning
This time I used TSAR search ", replace <147>
In the Edit Lyrics window it showed “This is O'Hara.”   However, all the lyric under the music showed was “ [curly quote was the only thing visible under the first note] This is
Clearly a character not in the Times New Roman set was being added in addition to the changed quote or apostrophe symbol.
So, it seems there are other oddities when trying to search and replace using ASCII code in the Windows Finale.

Finale 2004b.r1, Windows XP, TGTools

Posted By : Jim Coull - 5/9/2004 1:24 PM

I don't know if this will help or not (or even if it applies here), but in most word processors, when you select curly quotes as an option in the word processor, it does not replace the straight quotes and apostrophes (" & ') with the actual ASCI character for the curly quotes/apostrophes. If you want a "true" curly quote, you have to actually type it (i.e., opt-[ on the Mac). It's similar to difference that you get when you apply the bold or italic style to a roman font like Times. Applying italic to Times is not the same as selecting ITimesItalic from the font menu.

Posted By : Michael Johnson - 5/10/2004 2:19 PM
Hi Graeme,
I had a different experience from you with regard to your example. I did not get the extra character tacked on to the end. Perhaps in your "replace" field of TSAR, you included a character in addition to the <146> character.
I will add your name to the list of users requesting "smart" functionality for apostrophes and quotation marks.

Michael Johnson
QA Supervisor

Posted By : Graeme Gilmore - 5/10/2004 9:58 PM
I don't know why we get different results, but my replace field consisted only of an ACCII code (e.g.,
TSAR reliably adds the strange character in this situation.
Anyway, it would be nice to have curly quotes and apostrophe's available, so I'm glad you added me to the list.

Finale 2004b.r1, Windows XP, TGTools