|MakeMusic Forum > Public Forums > FinaleScript - FORUM HAS MOVED! > Unable to get the Text Blocks attribute for text search and replace to work ||Forum Quick Jump|
Date Joined Aug 2004
Total Posts : 239
| Posted 12/6/2009 12:32 PM (GMT -5) |
I have been unable to script text search & replace just in text boxes, even though the documentation says it should work. However, I have used a large number of TSRs that seem to accomplish what you're trying to do. If you have a pre-existing text box that you want to edit & you know in advance what's in it, FS can search for the content & then act upon it. If you want to take an existing text box & position it, FS can also do that, after it's selected. A third option, which became extremely useful to me, is to use FS to create the text box (content) AND position it where desired.
Since I don't know the specifics of your situation, I'm unsure which will work best. An example that may help is:
Search "" [Times New Roman] Italic 15, Replace "" [Palatino Linotype] Italic 19
This script replaces all items in Times New Roman Italic 15 with Palatino Linotype Italic 19. Since my documents have unique fonts for almost everything, this works for most cases. However, sometimes I must define the TSR function better. In files I work with a lot (Church hymns), the word "chorus" can appear in various instances. One is as the chorus of a hymn, which is in a text box with a specific font & all capital letters. Another is in a text box footer in a different font in all small letters. A third is in lyrics. This script searches the font as well as the case:
Search "CHORUS" Match Case, replace "CCC"
Search "CCC" replace "CHORUS" Italic 11
This takes care of the first instance. It had to be a 2-part script because "chorus" occasionally appears in lyrics with the same font. By matching the case, it only replaced "CHORUS" (with "CCC"), not "chorus" or "Chorus". Since "CCC" would never appear in text boxes, lyrics, staff names, etc., the 2nd TSR always replaces "CCC" with "CHORUS" in Italic 11. The font style did not need to change.
The second instance is done through the following script:
Search "" [Palatino Linotype] italic 9, replace "" 10
This is a simple TSR & all that is needed to change fonts on "chorus" & everything else in the footer text box. The third instance is handled in the same manner as the second, with only the font changes:
Search "" [Palatino Linotype], regular 15 replace "" 16
This changes "chorus" & everything else in lyrics to a different font.
If you need further assistance or think that the technique to create a text box from scratch would be helpful, please let me know.
|Back to Top|
|Currently it is Thursday, July 29, 2021 9:33 PM (GMT -5)|
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-2021