Adding frames around text blocks globally

General notation questions, including advanced notation, formatting, etc., go here.

Moderators: Peter Thomsen, miker

Capricorn
Posts: 125
Joined: Fri Jan 27, 2017 2:38 pm
Finale Version: Finale 25X
Operating System: Mac

Post by Capricorn » Sun Apr 14, 2019 5:47 pm

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


User avatar
HaraldS
Posts: 229
Joined: Mon Dec 19, 2016 11:46 am
Finale Version: 25.5
Operating System: Windows

Post by HaraldS » Mon Apr 15, 2019 11:43 am

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
Finale 3.0-25.5, German edition, Windows 7
trombonist, pianist, conductor / Recklinghausen, Germany

mmike
Posts: 446
Joined: Sat Feb 22, 2014 5:28 pm
Finale Version: 27.4
Operating System: Windows

Post by mmike » Mon Apr 15, 2019 12:46 pm

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.
Finale 3.7 > 27.4.1, GPO5, ASUS laptop, 18.4'' display, Intel Core i7, 32GB RAM, WIN 10 Pro, Cubase

User avatar
HaraldS
Posts: 229
Joined: Mon Dec 19, 2016 11:46 am
Finale Version: 25.5
Operating System: Windows

Post by HaraldS » Mon Apr 15, 2019 1:38 pm

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.
Finale 3.0-25.5, German edition, Windows 7
trombonist, pianist, conductor / Recklinghausen, Germany

Capricorn
Posts: 125
Joined: Fri Jan 27, 2017 2:38 pm
Finale Version: Finale 25X
Operating System: Mac

Post by Capricorn » Mon Apr 15, 2019 2:04 pm

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

mmike
Posts: 446
Joined: Sat Feb 22, 2014 5:28 pm
Finale Version: 27.4
Operating System: Windows

Post by mmike » Mon Apr 15, 2019 2:31 pm

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?
Finale 3.7 > 27.4.1, GPO5, ASUS laptop, 18.4'' display, Intel Core i7, 32GB RAM, WIN 10 Pro, Cubase

User avatar
HaraldS
Posts: 229
Joined: Mon Dec 19, 2016 11:46 am
Finale Version: 25.5
Operating System: Windows

Post by HaraldS » Mon Apr 15, 2019 2:39 pm

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.
Finale 3.0-25.5, German edition, Windows 7
trombonist, pianist, conductor / Recklinghausen, Germany

mmike
Posts: 446
Joined: Sat Feb 22, 2014 5:28 pm
Finale Version: 27.4
Operating System: Windows

Post by mmike » Mon Apr 15, 2019 3:07 pm

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?
Last edited by mmike on Mon Apr 15, 2019 3:25 pm, edited 1 time in total.
Finale 3.7 > 27.4.1, GPO5, ASUS laptop, 18.4'' display, Intel Core i7, 32GB RAM, WIN 10 Pro, Cubase

Capricorn
Posts: 125
Joined: Fri Jan 27, 2017 2:38 pm
Finale Version: Finale 25X
Operating System: Mac

Post by Capricorn » Mon Apr 15, 2019 3:19 pm

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.

User avatar
HaraldS
Posts: 229
Joined: Mon Dec 19, 2016 11:46 am
Finale Version: 25.5
Operating System: Windows

Post by HaraldS » Mon Apr 15, 2019 3:32 pm

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.
Finale 3.0-25.5, German edition, Windows 7
trombonist, pianist, conductor / Recklinghausen, Germany

mmike
Posts: 446
Joined: Sat Feb 22, 2014 5:28 pm
Finale Version: 27.4
Operating System: Windows

Post by mmike » Mon Apr 15, 2019 3:56 pm

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
Finale 3.7 > 27.4.1, GPO5, ASUS laptop, 18.4'' display, Intel Core i7, 32GB RAM, WIN 10 Pro, Cubase

User avatar
HaraldS
Posts: 229
Joined: Mon Dec 19, 2016 11:46 am
Finale Version: 25.5
Operating System: Windows

Post by HaraldS » Mon Apr 15, 2019 4:34 pm

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?
Finale 3.0-25.5, German edition, Windows 7
trombonist, pianist, conductor / Recklinghausen, Germany

mmike
Posts: 446
Joined: Sat Feb 22, 2014 5:28 pm
Finale Version: 27.4
Operating System: Windows

Post by mmike » Mon Apr 15, 2019 4:40 pm

Do you have a Finale file open with measure-attached text blocks?
Yes
Finale 3.7 > 27.4.1, GPO5, ASUS laptop, 18.4'' display, Intel Core i7, 32GB RAM, WIN 10 Pro, Cubase

User avatar
motet
Posts: 8226
Joined: Tue Dec 06, 2016 8:33 pm
Finale Version: 2014.5,2011,2005,27
Operating System: Windows

Post by motet » Mon Apr 15, 2019 4:46 pm

I don't see FCCCellTexts in the class browser.

mmike
Posts: 446
Joined: Sat Feb 22, 2014 5:28 pm
Finale Version: 27.4
Operating System: Windows

Post by mmike » Mon Apr 15, 2019 4:51 pm

here's the whole Lua window
Finale 3.7 > 27.4.1, GPO5, ASUS laptop, 18.4'' display, Intel Core i7, 32GB RAM, WIN 10 Pro, Cubase

User avatar
HaraldS
Posts: 229
Joined: Mon Dec 19, 2016 11:46 am
Finale Version: 25.5
Operating System: Windows

Post by HaraldS » Mon Apr 15, 2019 5:14 pm

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.
Finale 3.0-25.5, German edition, Windows 7
trombonist, pianist, conductor / Recklinghausen, Germany

mmike
Posts: 446
Joined: Sat Feb 22, 2014 5:28 pm
Finale Version: 27.4
Operating System: Windows

Post by mmike » Mon Apr 15, 2019 5:42 pm

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
Finale 3.7 > 27.4.1, GPO5, ASUS laptop, 18.4'' display, Intel Core i7, 32GB RAM, WIN 10 Pro, Cubase

User avatar
motet
Posts: 8226
Joined: Tue Dec 06, 2016 8:33 pm
Finale Version: 2014.5,2011,2005,27
Operating System: Windows

Post by motet » Mon Apr 15, 2019 6:12 pm

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.

User avatar
michelp
Posts: 2045
Joined: Fri Jul 25, 2003 3:35 pm
Finale Version: 27.4.1,26.3.1, Mont.
Operating System: Mac

Post by michelp » Mon Apr 15, 2019 6:17 pm

Michel
MacOsX 12.7.4, Finale 27.4.1 & 26.3.1, Mac Mini Intel Dual Core i7 3Ghz, 16 Go Ram. Azerty kb. MOTU Midi Express XT USB, Roland Sound Canvas SC-88vl, MOTU Audio Express. 2 monitors (27"' pivot, 24'"), JW Lua, RGP Lua

User avatar
motet
Posts: 8226
Joined: Tue Dec 06, 2016 8:33 pm
Finale Version: 2014.5,2011,2005,27
Operating System: Windows

Post by motet » Mon Apr 15, 2019 6:19 pm

I'm not sure if you're answering me, but how to you determine the version number of an installed JW plug-in?

User avatar
michelp
Posts: 2045
Joined: Fri Jul 25, 2003 3:35 pm
Finale Version: 27.4.1,26.3.1, Mont.
Operating System: Mac

Post by michelp » Mon Apr 15, 2019 6:42 pm

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
Michel
MacOsX 12.7.4, Finale 27.4.1 & 26.3.1, Mac Mini Intel Dual Core i7 3Ghz, 16 Go Ram. Azerty kb. MOTU Midi Express XT USB, Roland Sound Canvas SC-88vl, MOTU Audio Express. 2 monitors (27"' pivot, 24'"), JW Lua, RGP Lua

User avatar
motet
Posts: 8226
Joined: Tue Dec 06, 2016 8:33 pm
Finale Version: 2014.5,2011,2005,27
Operating System: Windows

Post by motet » Mon Apr 15, 2019 6:48 pm

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?).

User avatar
HaraldS
Posts: 229
Joined: Mon Dec 19, 2016 11:46 am
Finale Version: 25.5
Operating System: Windows

Post by HaraldS » Mon Apr 15, 2019 7:22 pm

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).
Finale 3.0-25.5, German edition, Windows 7
trombonist, pianist, conductor / Recklinghausen, Germany

mmike
Posts: 446
Joined: Sat Feb 22, 2014 5:28 pm
Finale Version: 27.4
Operating System: Windows

Post by mmike » Mon Apr 15, 2019 7:41 pm

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?
Finale 3.7 > 27.4.1, GPO5, ASUS laptop, 18.4'' display, Intel Core i7, 32GB RAM, WIN 10 Pro, Cubase

User avatar
HaraldS
Posts: 229
Joined: Mon Dec 19, 2016 11:46 am
Finale Version: 25.5
Operating System: Windows

Post by HaraldS » Mon Apr 15, 2019 8:25 pm

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.
Finale 3.0-25.5, German edition, Windows 7
trombonist, pianist, conductor / Recklinghausen, Germany

Post Reply