[JW Lua] Hello World

Jari Williamsson jari.williamsson at mailbox.swipnet.se
Tue Oct 15 18:55:29 CEST 2013


On 2013-10-15 18:26, Dave Foster wrote:

> Next challenge - create some text - this doesn't seem to get anything to show up, either on the page or in the FCPageTexts:
>
> local newText = finale.FCPageText()
> newText:SetFirstPage(1)
> newText:SetLastPage(1)
> newText:SetVerticalPos(-72)
> newText:SetHorizontalPos(1)
> local textObject = newText:CreateTextString()
> textObject:AppendLuaString("^font(Arial Black,4096)^size(24)^nfx(0)It Works!")
> newText:SaveTextBlock(textObject)
>
> Any thoughts?

1. If you do "print(newText:SaveTextBlock(textObject))", you'll see that 
it returns false. Replace "SaveTextBlock" with "SaveNewTextBlock". Since 
you're creating a new page text, you cannot replace a text pool item 
that doesn't exist. You should even be able to do "local textObject = 
finale.FCString()" in this case as well, since "CreateTextString()" will 
never return any text.
2. After the Enigma text block has been saved, save the page text 
object. Add "newText:SaveNew(1)" at the end and the text will appear.

> Finally, I see that Finale 2014 is on the way - anybody got any
> insider knowledge about new scripting abilities that might be coming
> to make some of this obsolete? I suspect there won't be anything,
> but would be good to know before I invest too much time…

I know what the next Finale version will contain, but I can't tell you 
yet. However, I believe you're time spent in JW Lua will be as 
worthwhile in the next Finale version as in Finale 2012.

I'll reply with a separate post regarding the string parsing loop. It's 
actually quite easy.


Best regards,

Jari Williamsson





More information about the JWLua mailing list