[JW Lua] FCStaffStyleAssign.EndMeasure returns wrong values: greater than the number of measures

Jan Angermüller jan at angermueller.com
Thu Apr 14 11:45:52 CEST 2016


Jari,

it's possible to manipulate a Finale document through measure inserts / 
deletes (not through JW Lua, but manually in Finale), so that the 
FCStaffStyleAssign.EndMeasure returns a former end measure number that 
doesn't exist anymore. It seems to be a Finale bug, although I have not 
yet found a definite way to reproduce this problem.
See attached document and run the script below:
although the piece has only 7 measures and the staff style is attached 
to measures 2 to 6, the script returns measure 24 (!) as end measure of 
the staff style.

Maybe you could add as a workaround that FCStaffStyleAssign.EndMeasure 
can never be greater than the last number of the piece ? That's how I 
solved it on my side.

Best,
Jan

Test script:
local staffstyleassigns=finale.FCStaffStyleAssigns()
local region=finale.FCMusicRegion()
region:SetFullDocument()
for slot=region.StartSlot,region.EndSlot,1 do
    local j  =region:CalcStaffNumber(slot)
    staffstyleassigns:LoadAllForItem(j)
    for ssa in each(staffstyleassigns) do
         print(ssa.StartMeasure,ssa.EndMeasure)
     end
end

Running [Unnamed Script] ======>
2 24
<======= [Unnamed Script] succeeded (Processing time: 0.000 s).

-------------- next part --------------
A non-text attachment was scrubbed...
Name: staff style assigns.mus
Type: application/octet-stream
Size: 31394 bytes
Desc: not available
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20160414/34932f0b/attachment.obj>


More information about the JWLua mailing list