[JW Lua] Changing noteheads in FCPercussionLayoutNotes only works after manual undo/redo
Jan Angermüller
jan at angermueller.com
Thu Apr 2 19:28:44 CEST 2015
Jari,
when changing the notehead symbols in a percussion layout,
I have the problem that the noteheads are changed in the
percussion layout table, but not automatically updated in the score.
Now the strange thing: when I press "Undo" and then "Re-do" after
running the script, the changed noteheads appear in the score.
It seems to me that there is an update function missing internally
in JW Lua that the Finale Re-do function seems to call.
See script below and this youtube screencam video
which demonstrates the behaviour in realtime: http://youtu.be/_Oo4fLq7qiE
In the video I first show how the percussion layout looks before,
then I run the script, then I undo and re-do it. Then the changed x
noteheads appear.
They also do appear when I open the percussion layout dialog after
running the script
and click on ok without changing anything. Clicking ok applies the
selected percussion layout once more.
Simply pressing on CTRL-U or CTRL-D doesn't help.
Any clues what might be wrong here ?
Best regards,
Jan
To run the script, *f**irst select a percussion staff* *with a
percussion layout attached *(i.e. a staff that is set to "Notation
Style: Percussion"):
local percstaff=finale.FCStaff()
percstaff:Load(finenv.Region().StartStaff) --load selected percussion staff
if percstaff:IsPercussion() then
local perclayoutID = percstaff:CalcPercussionLayoutID()
local perclayout=finale.FCPercussionLayoutNotes()
perclayout:LoadAllForItem(perclayoutID)
if perclayout~=nil then
for layoutnote in each(perclayout) do
layoutnote:SetClosedNotehead(string.byte("x")) --set all
closed noteheads to "x"
layoutnote:Save()
end
end
end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20150402/20c5e1db/attachment.htm>
More information about the JWLua
mailing list