The original version of this page can be found at : http://forum.makemusic.com/default.aspx?f=12&m=388429
Posted By : UCG Musician - 1/13/2013 1:19 PM
Does anyone know a way to use a wildcard in a text search and replace command through FS?
 
I have numerous files containing text boxes with quoted text.  The quote marks are the type created from the keyboard (Shift + ' Key).  The open quote and the close quote are thus the same character.  If it's possible to replace the open quote with a calligrapher's left quote mark (a "curly" quote) and the close quote with a calligrapher's right quote mark I would like to do so.
 
It would require FS to use a wildcard because I could not replace all quote marks with a left or right calligrapher's type.  Can FS use a wildcard to search for "X and replace it with “X and search for Y" and replace it with Y”?  This logic should produce the desired result.  I can't find any documentation that says a wildcard feature exists in FS, but that doesn't mean it's not there somewhere!

Posted By : Peter West - 1/14/2013 11:02 AM
I would not use FS for this. In text search and replace you can use a spacebar character, so I would replace
[spacebar"] with [spacebar“] and
["spacebar] with [”spacebar], as this is probably going to be the standard pattern.

Without FS you can search replace in all open documents, and select text types, such as text expressions but not staff names, for example.
You can also select fonts and text sales so that only a certain font and style is affected.

However, the change in all open documents feature is perhaps the most powerful option


Peter
Music Publishing Services

*********************
Mac 2.66GHz Intel Quad, 4GB RAM /OSX.5.6 /30 inch cinema display+20 inch Cinema Display
Finale 2008 2009 2010/Logic Pro Studio/Komplete/GPO/Kore 2/Max.msp/Pluggo


Posted By : UCG Musician - 1/15/2013 9:57 AM
Peter, thank you for the idea but unfortunately that won't work in this application. This a hymnal project. The hymn name is centered at the top of the page. Then right below it is a scripture that starts and ends with a quote such as "His delight is in the law of the LORD". So there's no space before the first quote mark and there may or may not be one after the last quote mark. Because they're the same symbol, replacing a ["spacebar] with a [“spacebar] does nothing to the first quote but puts a space in front of the last one, yielding "His delight is in the law of the LORD ”.

The text search and replace feature is totally scriptable so if it can be done using the standard method it can also be scripted. There is one way I can image it working (and I have to think through it more), and that is to script replacing a quote plus every letter of the alphabet with a calligrapher's open quote and the same letter of the alphabet. I tried replacing ["H] with [“H] and it worked in this instance. A similar thing would happen for the end of each quote. This would be a lot of work but I believe it could be done. Any thoughts on a possible alternative to this rather extensive solution?

Posted By : Peter West - 1/15/2013 1:03 PM
My initial thought was to pair each capital with an open quote and each lower case with a close quote. But if you want LORD in caps it won't work.
Of course using .” will solve many occurrences within text, as would the use of the space bar.

In titles it is more problematic.

I suppose you could set up 104 lines so that you have
"a
"A
a"
A"

etc.

As you say. it's a bit laborious, but it should work.


Peter
Music Publishing Services

*********************
Mac 2.66GHz Intel Quad, 4GB RAM /OSX.5.6 /30 inch cinema display+20 inch Cinema Display
Finale 2008 2009 2010/Logic Pro Studio/Komplete/GPO/Kore 2/Max.msp/Pluggo