[JW Lua] FCLuaIterator problem

Charles O. Lawrence charlesolawrence at bellsouth.net
Thu Dec 17 17:38:10 CET 2015


Jari,

The following code always crashes Finale hard, so that a reboot is usually
necessary to get any control back.

Am I missing something, or is there a problem with the iterator?

I am trying to "improve" on the working code of HaraldS by replacing the
"deprecated" for..each()..do..end code with the newer FCLuaIterator().

Thanks,
Charles

------------------------------------------------------------------------
function callback(c)
   if c.ChordSuffixID == 27 then c.ChordSuffixID = 33 end
end
local iterator = finale.FCLuaIterator()
iterator:ForEachRegionObjectSaved(finenv.Region(),finale.FCID_CHORD,callback
)

--[[ original code by HaraldS
local chords = finale.FCChords()
local n = chords:LoadAllForRegion(finenv.Region())
for c in each(chords) do
   if c.ChordSuffixID == 27 then c.ChordSuffixID = 33 end
end
chords:SaveAll()
--]]





More information about the JWLua mailing list