[JW Lua] FCGroup:ContainsStaff /CalcStaffIndex returns wrong values

Jan Angermüller jan at angermueller.com
Mon Sep 18 13:16:02 CEST 2017


Jari,

yesterday there was a post with a Finale document on the Finale 
Powerusers Group on Facebook ( 
https://www.facebook.com/groups/finalepower/1919405684943557/ ) which I 
used for testing some JW Lua features.
I noticed a bug in calculating if a staff belongs to a group 
(FCGroup:ContainsStaff, FCGroup:CalcStaffIndex).

If you select measure 283 on page 40 on the staff labeled "IV" (the one 
with the ffff at the end), both calculations return false / -1 instead 
of being part of group 16.
Here is a video demo: https://www.youtube.com/watch?v=bUkhYWnU5lY

Test script (select the measure above and run script):
local groups=finale.FCGroups()
groups:LoadAll()
for g in each(groups) do
print(g:GetItemID(),g:ContainsStaff(finenv.Region().StartStaff),g:CalcStaffIndex(finenv.Region().StartStaff))
end

Running [Unnamed Script] ======>
1 false -1
2 false -1
3 false -1
4 false -1
10 false -1
11 false -1
12 false -1
13 false -1
14 false -1
15 false -1
16 false -1  --should return true and 1
17 false -1
<======= [Unnamed Script] succeeded (Processing time: 0.000 s).

I assume that you can download the file via the link above, otherwise I 
can mail you the document via PM.

Best,
Jan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20170918/7ed75e82/attachment.htm>


More information about the JWLua mailing list