Page 1 of 2

Adding frames around text blocks globally

Posted: Sun Apr 14, 2019 5:47 pm
by Capricorn
I want to put frames around text blocks for a narrator to differentiate between his dialogue and the dialogue of the singers. I know how to do it with the Standard Frame in Text but is there a way it can be done globally so I don't have to put in the numbers every time? I have Finale 25 on High Sierra. Thanks!
Capricorn

Re: Adding frames around text blocks globally

Posted: Mon Apr 15, 2019 11:43 am
by HaraldS
Capricorn wrote:I want to put frames around text blocks for a narrator to differentiate between his dialogue and the dialogue of the singers. I know how to do it with the Standard Frame in Text but is there a way it can be done globally so I don't have to put in the numbers every time?
This can be done by this JWLua script:

Code: Select all

pagetexts = finale.FCPageTexts()
pagetexts:LoadAll()

for pagetext in each(pagetexts) do
    local str = pagetext:CreateTextString()
    local textblock = pagetext:CreateTextBlock()
    textblock:SetShowBorders( true )
    textblock.LineInset = 200
    textblock.LineWidth = 100
    textblock:Save()
end
The value "LineInset" stands for the distance between the text and the frame. The unit is EFIX, which means, you can either try out some high numbers or dig deeper into the topic here. The value "LineWidth" means the width of the line.

Harald

Re: Adding frames around text blocks globally

Posted: Mon Apr 15, 2019 12:46 pm
by mmike
How exactly does this work? What is the procedure?
Select something? all? in a Finale document and then run the script file?
I made an .ahk file, but when I open it, it lists a number of errors on various lines and then exits, without any action.

Re: Adding frames around text blocks globally

Posted: Mon Apr 15, 2019 1:38 pm
by HaraldS
mmike wrote:How exactly does this work? What is the procedure?
Select something? all? in a Finale document and then run the script file?
I made an .ahk file, but when I open it, it lists a number of errors on various lines and then exits, without any action.
It's a JWLua file, just click the link to JWLua above.
JWLua is a script language for Finale. The JWLua plug-in has to be installed first, then you can run scripts in that language inside this plug-in.

Re: Adding frames around text blocks globally

Posted: Mon Apr 15, 2019 2:04 pm
by Capricorn
I'll definitely look into this. My son-in-law is my computer guru so I'll run it by him. Thanks for the information.
Capricorn

Re: Adding frames around text blocks globally

Posted: Mon Apr 15, 2019 2:31 pm
by mmike
Sorry, wasn't paying attention ... since I use one of your AutoHotkey scripts a lot I just assumed it was an .ahk file.

However, I am not particularly adept at using LuaScrupts.
I pasted your script into a text editor and saved it as textframes.lua and put it into the Finale Lua folder.

Then I followed these instructions: "Open the JWLua plugin, select the "Manager" tab. There you can manage the appearance of JWLua scripts in Finale's plugin menu. In the window "Plug-In Groups" select [Menu], then near the window below "Items in Group:" click the "New..." button. In the opening file selection dialog, select the "textframes.lua" file. Click "Close" and restart Finale as requested. Then the script should appear in Finale's plugin menu much like every other plugin."

However, nothing happens. I assumed if I had a number of text frames without borders that it would then place borders around all of them. I select the frames themselves first, or also a staff or measures, but it doesn't work. Where am I going wrong?

Re: Adding frames around text blocks globally

Posted: Mon Apr 15, 2019 2:39 pm
by HaraldS
Mmike - just open the JWLua window and select the "Development" tab. Does that work? If yes, paste my script in there. A Finale file with at least one page text block must be open to have any effect. Hit "Run Script". All page text blocks should get frames.

The "Management" tab and the other parts of the JWLua window are just for fancier stuff like running scripts via hotkeys, sending parameters and the like. For just running a simple script, the "Development" tab is sufficent.

Re: Adding frames around text blocks globally

Posted: Mon Apr 15, 2019 3:07 pm
by mmike
Thanks, that works (however only with page attached text blocks, is that correct?)
All my text blocks would be created when working in scroll view in the process of entering a composition. If I want to create borders I would still have to do it indvidually as I am creating each text block or, then in page view, change each one to page attached......
Could you change the script so that it would work in scroll view?

More questions -
How and where in the Lua window can I change the name of the script?
I also tried to edit it, but failed - what numbers to use for a little more space around (left and right, not top and bottom) and for a thicker border? Where/how edit and save?

Re: Adding frames around text blocks globally

Posted: Mon Apr 15, 2019 3:19 pm
by Capricorn
This is all pretty complicated. I was just hoping Finale had something that would work globally already in the program like in Utilities (Change) or Document preferences. I ended up doing each text block individually.

Re: Adding frames around text blocks globally

Posted: Mon Apr 15, 2019 3:32 pm
by HaraldS
mmike wrote:Thanks, that works (however only with page attached text blocks, is that correct?)
Yes, correct. I understood the original poster's question in that way.
mmike wrote:Could you change the script so that it would work in scroll view?
Texts entered in scroll view are of type "FCCellTexts". For a quick-and-dirty version, change the first line pagetexts = finale.FCPageTexts() to this one: pagetexts = finale.FCCellTexts(). For better coding, the variable names would have to be adapted, but for the functionality, this isn't of any importance.
mmike wrote:How and where in the Lua window can I change the name of the script?
Select "Save..." in the upper drop-down-menu and give it an appropriate name.
mmike wrote:I also tried to edit it, but failed - what numbers to use for a little more space around (left and right, not top and bottom) and for a thicker border? Where/how edit and save?
Edit it in the development text field, save as described above. For more space and thicker lines, change the two numbers 200 and 100 to larger ones.

Re: Adding frames around text blocks globally

Posted: Mon Apr 15, 2019 3:56 pm
by mmike
change the first line pagetexts = finale.FCPageTexts() to this one: pagetexts = finale.FCCellTexts()
That doesn't seem to work. The script fails to run and a red dot appears on line 1

Re: Adding frames around text blocks globally

Posted: Mon Apr 15, 2019 4:34 pm
by HaraldS
mmike wrote:That doesn't seem to work. The script fails to run and a red dot appears on line 1
Well, what's the error message below then? Do you have a Finale file open with measure-attached text blocks?

Re: Adding frames around text blocks globally

Posted: Mon Apr 15, 2019 4:40 pm
by mmike
Do you have a Finale file open with measure-attached text blocks?
Yes

Re: Adding frames around text blocks globally

Posted: Mon Apr 15, 2019 4:46 pm
by motet
I don't see FCCCellTexts in the class browser.

Re: Adding frames around text blocks globally

Posted: Mon Apr 15, 2019 4:51 pm
by mmike
here's the whole Lua window

Re: Adding frames around text blocks globally

Posted: Mon Apr 15, 2019 5:14 pm
by HaraldS
Obviously, you're using Finale 2014.5. Possibly, you have a 32/64 bit issue, make sure you installed the correct JWLua version for your system. It's also possible that FCCellTexts isn't supported in the older versions (motet, that's a "C" too much). It's in the doc, and it's working on my system.

Re: Adding frames around text blocks globally

Posted: Mon Apr 15, 2019 5:42 pm
by mmike
make sure you installed the correct JWLua version for your system
Looks like I have Lua v0_45. My Finale version is 32-bit. Where, if available, do I find the correct Lua download? (cant find it on JW's site...)

Indeed FCCellTexts doesn't appear in the Class Documentation

Re: Adding frames around text blocks globally

Posted: Mon Apr 15, 2019 6:12 pm
by motet
Must just be missing from the 32-bit version (latest is 0.54 from September 2017).

How do you determine the version number of a JW plug-in, anyway? JW Lua is missing from the (now-broken) JW Plug-In Tool Manager.

Re: Adding frames around text blocks globally

Posted: Mon Apr 15, 2019 6:17 pm
by michelp

Re: Adding frames around text blocks globally

Posted: Mon Apr 15, 2019 6:19 pm
by motet
I'm not sure if you're answering me, but how to you determine the version number of an installed JW plug-in?

Re: Adding frames around text blocks globally

Posted: Mon Apr 15, 2019 6:42 pm
by michelp
I wasn't really answering you, but on the Mac, it seems that the only way is to locate the file jwlua64.bundle; its Infos window shows the version number.
 
lua.jpeg

Re: Adding frames around text blocks globally

Posted: Mon Apr 15, 2019 6:48 pm
by motet
Thanks. The Windows version does not have such a wrapper, alas. The version string doesn't seem to appear anywhere in the .fxt file:
$ strings jwlua.fxt | grep '0\.54'
$
Yet somehow JW Plug-in Manager knows (knew?) what version the other plug-ins are (or were). JW Lua is not included for some reason (because it's beta?).

Re: Adding frames around text blocks globally

Posted: Mon Apr 15, 2019 7:22 pm
by HaraldS
The following JWLua code should give Finale's version and the JWLua plug-in's version:

Code: Select all

print("Finale Version:  ",finenv.FinaleVersion)
print ("JWLua Plug-in Version:  ",finenv.StringVersion)
Which, in my case, returns:

Code: Select all

Running [Unnamed Script] ======>
Finale Version:   2025
JWLua Plug-in Version:   0.54
<======= [Unnamed Script] succeeded (Processing time: 0.000 s).

Re: Adding frames around text blocks globally

Posted: Mon Apr 15, 2019 7:41 pm
by mmike
This is what I have:
Running [Unnamed Script] ======>
Finale Version: 2014
JWLua Plug-in Version: 0.45
<======= [Unnamed Script] succeeded (Processing time: 0.000 s).

However ... I have removed that plug-in and downloaded and presumably installed the latest version 0.54, but it doesn't show in Finale. It still says 0.45. I put the Luafolder into the Finale LuaScripts folder. Isn't this where it should be?

Re: Adding frames around text blocks globally

Posted: Mon Apr 15, 2019 8:25 pm
by HaraldS
mmike wrote:This is what I have:
Finale Version: 2014
JWLua Plug-in Version: 0.45
Finale 2014 was a 32bit program. Lua 0.45 obviously as well. If this Lua version doesn't contain the FCCellText class (which it obviously does not), there's no way you can get it to work on your system.

JWLua 0.54 does indeed support this class, but it needs a 64bit version of Finale, thus meaning Finale 25 and above.