[JW Lua] Copying Percussion Layouts

Jan Angermüller jan at angermueller.com
Fri Mar 28 19:52:17 CET 2014


Jari,

is it possible to clone or create new percussion layouts from within Lua ?

I was successful in copying a percussion layout to an existing 
percussion layout
(overwriting the existing note type entries). The copied entries were 
available in the percussion layout designer.

I was also successful in copying a percussion layout to a new cmper and 
reading it from within Lua.
But: when I opened the "Percussion Layout Designer" dialog there were no 
new entries.
Do I have to call a "flush" that the percussion layout entries are updated ?

This is the code:

local PercLayout=finale.FCPercussionLayoutNotes()
PercLayout:LoadAllForItem(4)  --loads layout 4
PercLayout:SaveDataAs(4,9)   -- writes to layout 9

If layout 9 exists, its entries will be overwritten and are available in 
the layout designer
If it doesn't exist, the entries are copied, but are non-existent when 
opening the layout designer,
although they can be read within Lua.

Changing the name of the new percussion layout (SetNameString) would 
also be required.

Jan





More information about the JWLua mailing list