[JW Lua] Hello World

Dave Foster fozder at me.com
Mon Oct 14 18:15:02 CEST 2013


Hi Jari and all,

A colleague pointed me in the direction of your site and mailing list - first off, a big thank you for your work bringing this project to the wider world. I'm a music copyist, and have been being writing plugins for Sibelius for years to automate tedious tasks. I have always yearned for an accessible way to do the same within Finale, and it looks like you've gone and done it! 

Just dipping my toes into the water, I'm trying a couple of things (with a view to some of the aforementioned automation), firstly creating and editing Page Text. I'm struggling to find a way to edit the text properties (font, size) - I've tried a couple of ways but been thwarted both times:

1) Access and edit the FCFontInfo property of the FCString object accessed using the CreateTextString() method of FCPageText: I can edit the FCFontInfo properties, but can't find a way to update them in the FCString. This is as far as I can get:

local pageTexts = finale.FCPageTexts()
pageTexts:LoadAll()
for pageText in each(pageTexts) do
    local thisText = pageText:CreateTextString()
    local fontInfo = thisText:CreateLastFontInfo()
    fontInfo:SetSize(24)
    pageText:SaveTextBlock(thisText)
end

but it doesn't update the size. Am I missing a method in FCString which updates the FCFontInfo? I can edit the text itself:

local pageTexts = finale.FCPageTexts()
pageTexts:LoadAll()
for pageText in each(pageTexts) do
	local thisText = pageText:CreateTextString()
	thisText.LuaString = "It Works!"
	pageText:SaveTextBlock(thisText)
end

2) Edit the Enigma components directly from the FCString object - unfortunately trying to call CreateEnigmaStrings() crashes Finale (2012) - this is the code that does it for me:

local pageTexts = finale.FCPageTexts()
pageTexts:LoadAll()
for pageText in each(pageTexts) do
	local thisText = pageText:CreateTextString()
	local enigmaStrings = thisText:CreateEnigmaStrings(false)
end

Secondly, I'd love to be able to access and edit the properties of measure number regions - specifically font and position of measure numbers (can't tell you how much time I spend editing them) but notice that the FCMeasureNumberRegion isn't accessible to JWLua - any plans to add that functionality?

Thanks again,

Dave Foster



More information about the JWLua mailing list