|
|
MakeMusic Forum > Public Forums > FinaleScript - FORUM HAS MOVED! > Search and Replace Problem | Forum Quick Jump
|
| Graeme Gilmore Registered Member
Date Joined Aug 2000 Total Posts : 371 | Posted 4/29/2004 6:36 AM (GMT -6) | |
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.
Graeme
Finale 2004b.r1, Windows XP, TGTools Post Edited (Graeme Gilmore) : 4/29/2004 11:39:28 AM GMT | Back to Top | |
| Peter Thomsen Registered Member
Date Joined Jun 2000 Total Posts : 8331 | Posted 4/29/2004 7:25 AM (GMT -6) | | 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.
Peter | Back to Top | |
| Graeme Gilmore Registered Member
Date Joined Aug 2000 Total Posts : 371 | Posted 5/5/2004 9:16 PM (GMT -6) | | 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 Graeme
Finale 2004b.r1, Windows XP, TGTools | Back to Top | |
| Michael Johnson Registered Member
Date Joined Mar 2004 Total Posts : 1317 | Posted 5/7/2004 8:54 AM (GMT -6) | |
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
MakeMusic! | Back to Top | |
| Graeme Gilmore Registered Member
Date Joined Aug 2000 Total Posts : 371 | Posted 5/8/2004 9:31 PM (GMT -6) | |
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.
Graeme
Finale 2004b.r1, Windows XP, TGTools | Back to Top | |
| Jim Coull Registered Member
Date Joined Jun 1999 Total Posts : 2723 | Posted 5/9/2004 12:24 PM (GMT -6) | | Graeme,
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. | Back to Top | | Forum Information | Currently it is Tuesday, December 19, 2023 6:24 PM (GMT -6) There are a total of 403,820 posts in 58,165 threads. In the last 3 days there were 0 new threads and 0 reply posts. View Active Threads
|
Forum powered by dotNetBB v2.42EC SP3 dotNetBB © 2000-2023 |
|
|