The original version of this page can be found at : http://forum.makemusic.com/default.aspx?f=11&m=404175
Posted By : Jari Williamsson - 7/30/2013 3:14 PM
I'm hooking up my PDK Framework to the Lua script language (so you can write your own plug-ins in Finale), and the early tests seem to work perfectly. The code below is an example of a fully functional plug-in task. Look and see if you can understand what the script does:
----
region = finale.FCMusicRegion()
region:SetCurrentSelection()
measures = finale.FCMeasures()
measures:LoadRegion(region)
for measure in each(measures) do
measure.Width = measure.Width * 110 / 100
end
measures:SaveAll()
---


Jari Williamsson

Windows XP, Pentium 4
2.40 GHz, 4 GB RAM

www.finaletips.nu - The Finale Productivity Tips site


Posted By : LO - 7/31/2013 3:46 AM
Hi Jari,
this is a great idea!!! The code is understandable for me and - if we would get some examples more - I believe for many other users. Sometimes I have tried to produce Plugins with several FIN PDKs, but never had success, though I got support by Thomas Giesen. This could be the beginning of a new area...
Do you think LUA will allow us also to use dialogs for the data input?

Thank you for your plan and regards
LO


Lothar

Intel i5-3570, 3,4GHz QuadCore
RAM: 8 GB OS: Win 8 64 Bit
Finale 3.5 - 2012r3 / TGTools full / Smartscore X Prof.
Germany

www.lothars-music-edition.com


Posted By : Jari Williamsson - 7/31/2013 11:55 AM
LO said...
Do you think LUA will allow us also to use dialogs for the data input?


Lua will basically support whatever I choose to support, and I plan to provide dialog support through the PDK Framework methods later on. Lua is very different to other script languages, as it's designed to be an embedded "glue" language. (It's also extremely fast compared to other script languages, that's why it's used in lots of large games, for example.) My PDK Framework is designed to be easily scriptable, and for Lua the cost on my part is extremely small to make efficient scripting happening. The PDK Framework documentation will be used as the script documentation as well, I'll later provide information in a wiki on how to read the PDK Framework documentation from a scripting point of view. (In the future, I might also write tasks in my larger C++ plug-ins directly as embedded Lua.)

I'll also soon start a separate mailing list for all topics regarding using the script plug-in.

Here's another fully featured plug-in example. It browses through each part (including the score view) of a document, loads the first page of each part, and makes sure that the width/height/percent are identical on all subsequent pages in each part:


allparts = finale.FCParts()
allparts:LoadAll()
for apart in each (allparts) do
    apart:SwitchTo()
    pageone = finale.FCPage()
    pageone:Load(1)
    allpages = finale.FCPages()
    allpages:LoadAll()
    for apage in each(allpages) do
        if apage.ItemNo > 1 then
            apage.Width = pageone.Width
            apage.Height = pageone.Height
            apage.Percent = pageone.Percent
            apage:Save()
        end
    end
    apart:SwitchBack()
end


Jari Williamsson

Windows XP, Pentium 4
2.40 GHz, 4 GB RAM

www.finaletips.nu - The Finale Productivity Tips site

Post Edited (Jari Williamsson) : 7/31/2013 6:14:53 PM (GMT-5)


Posted By : Jari Williamsson - 8/1/2013 6:23 PM
I have now created a specific mailing list for the "JW Lua" plug-in (a plug-in to run scripts as fully-featured plug-ins in Finale), where you can discuss the plug-in, script programming, share scripts, etc.

Sign up for that mailing list at:
http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu

There's now also a Wiki (still in progress) for "JW Lua" at:
http://jwmusic.nu/jwplugins/wiki/doku.php?id=jw_lua

I hope to have a first plug-in beta of "JW Lua" available for download some day next week.


Jari Williamsson

Windows XP, Pentium 4
2.40 GHz, 4 GB RAM

www.finaletips.nu - The Finale Productivity Tips site


Posted By : Charles Lawrence - 8/2/2013 8:01 AM
This is a great idea!  Looks like this will be much more versatile and useful, and need I say bug free than the present Finalescript.
 
Thanks for all you do.


"Anything is possible if you don't know what you are talking about!"

 

Dell XPS 600, GenuineIntel Intel(R) Pentium(R) D CPU 3.00GHz [Intel64 Family 15 Model 4 Stepping 4] (2 processors)
8GB Ram
HT Omega Striker 7.1
MSI N430GT 2GB GPU
1TB x 4 internal HD's

Microsoft Windows 7 Ultimate x64 Edition, (06.01.7600.00)
Finale 2012c.r13

 

"There is a world of difference between a person who has a big problem and a person who makes a problem big." – John Maxwell