[JW Lua] system freezes

Joseph Weidinger jsphweid at gmail.com
Thu May 14 22:20:31 CEST 2015


Hi Jari,

I'm having difficulty using StaffSystem's CreateFreezeSystem and
FCFreezeSystem. Apparently they have to be used together somehow "The
FCStaffSystem
<http://www.finaletips.nu/frameworkref/class_f_c_staff_system.html> object
must also be updated to match the frozen systems."  Could you provide a
basic example of say freezing all systems in a part?

I'm working on a script that cycles through all parts making 4 measures per
system.  I got most of the logic down, but I don't understand this
dual-updating of sorts and saving.  Where am I going wrong?

allparts = finale.FCParts()
allparts:LoadAll()
for onepart in each (allparts) do
onepart:SwitchTo()
local staffsystems = finale.FCStaffSystems()
staffsystems:LoadAll()
local multimeasurerests = finale.FCMultiMeasureRests()
multimeasurerests:LoadAll()
local i = 1
for ss in each(staffsystems) do
    mmrLengths = 0
for mmr in each(multimeasurerests) do -- take into account MMR
    if ss:ContainsMeasure(mmr.StartMeasure) then
     mmrLengths = mmrLengths + (mmr.EndMeasure - mmr.StartMeasure) --
actual length - 1
    end
end
-- finale.FCStaffSystems.UpdateFullLayout() -- takes a long time
    ss:SetFirstMeasure_(i)
i = i + 4 + mmrLengths + 1
ss:SetNextSysMeasure_(i)
ss:CreateFreezeSystem(true)
ss:Save()
-- local fs = finale.FCFreezeSystem() -- not sure how this works together
-- fs.NextSysMeasure = i
-- fs:Save()
end
onepart:SwitchBack()
end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20150514/257af6ff/attachment-0002.html>


More information about the JWLua mailing list