[JW Lua] Read FileInfoText + Display the value of variable

Bart Visser bartvisser at me.com
Tue Nov 12 17:11:53 CET 2013


Hi all,

The page with sample-scripts contains a sample for setting the FileInfoText (composer). I’m trying to read the FileInfo, but can’t seem to find a way to read the actual text into a variable. This is my code:

local title_text = finale.FCFileInfoText()
result = title_text:LoadTitle() --result: true (so something happens)
print(title_text) -- result: Userdata: 0x7964ddb2 (but I want to display the actual title, say ‘My Song’)

I’ve looked at parent classes and other examples, but haven’t found a solution yet. Does anyone know what I’m doing wrong?

This all made me think: is there a Lua-variant of the Ruby ‘inspect’ method (googled for it, but without succes)? While I was learning the Ruby language I used it all the time so see what was happening in the background. Lua's print()-function, for example, doesn’t display the contents of a table, just that something is a table… (or am I wrong?). I’ve used the ‘dumpproperties(any_object)’-function, but some objects aren’t suitable for this kind of representation.

Thanks,


Bart Visser (who loves the direct and deep way JW Lua let’s him interact with a score. Thanks Jari!)



More information about the JWLua mailing list