The original version of this page can be found at : http://forum.makemusic.com/default.aspx?f=12&m=381453
Posted By : Jon Senge - 10/18/2012 11:53 AM
I need to find and replace ordinals with superscript ordinals (1st, 2nd, etc.) in text blocks. Is this scriptable, and if so, how would I write it to select specific characters in the text block and then run a series of menu commands to get to superscript? The Finalescript's font swapping abilities do not allow for any of these more specific font settings.

Any help would be greatly appreciated!


Twitter: @jonsenge
2.3 GHz rMBP, 8GB RAM, OS 10.8.0 | 2.8 GHz Intel Core 2 Duo iMac, 2 GB RAM, OS 10.6.7,
Finale 2004-12b, Sibelius 4-7


Posted By : Kelby - 10/25/2012 12:16 PM
I have come up with a solution using Times New Roman. There are a few defined superscript characters that work really well and this script works. You may need to tweak it to work with your font. Furthermore you will need Finale 2012 to get access to the Unicode field of characters.

Hopefully the font set you are using is Unicode compliant.
NOTE: There is one issue. Because I used a differently defined 'n' character, the baseline will be off kilter depending upon the font.

-K

//search and replace st, nd, rd, th with unicode superscript characters
// ˢ character U+02E2 (738) MODIFIER LETTER SMALL
// ᵗ character U+1D57 (1721) MODIFIER LETTER SMALL
// ⁿ character U+207F (2374) SUPERscript LATIN SMALL LETTER
// ᵈ character U+1D48 (1706) MODIFIER LETTER SMALL
// ʳ character U+02B3 (691) MODIFIER LETTER SMALL
// ʰ character U+02B0 (688) MODIFIER LETTER SMALL


search expressions "1st" and replace with "1ˢᵗ"
search expressions "ˢᵗ" and replace with "ˢᵗ" [Times New Roman] 13

search expressions "2nd" and replace with "2ⁿᵈ"
search expressions "ⁿᵈ" and replace with "ⁿᵈ" [Times New Roman] 13

search expressions "3rd" and replace with "3ʳᵈ"
search expressions "ʳᵈ" and replace with "ʳᵈ" [Times New Roman] 13

search expressions "4th" and replace with "4ᵗʰ"
search expressions "ᵗʰ" and replace with "ᵗʰ" [Times New Roman] 13
________________________________________
Kelby


Kelby
 
"Talent Borrows, Genius Steals" Igor Stravinsky
Mac and PC Finale user since version 3.5+