[JW Lua] Reverse dumpproperties (Lua-table to properties)

Bart Visser bartvisser at me.com
Mon Nov 18 17:26:51 CET 2013


Dear all,

Is there a built in way to read a Lua-table (property => value) into an JW Lua-object? At the moment, if I want to convert Lua-table into property-values, I have to write out each and every property:

local table_with_properties = table.load( path_to_file )
local page_format = finale.FCPageFormatPrefs()
page_format.FirstSystemTop = table_with_properties["FirstSystemTop"]
page_format.FirstSystemLeft = table_with_properties["FirstSystemLeft"]
etc.

I'm looking for something like:

for k, v in pairs(table_with_properties) do
  page_format:SetProperty(k, v)
end

Is this possible?

Thanks,


Bart Visser



More information about the JWLua mailing list