[JW Lua] FCStaffStyleDefs:LoadAll() doesn't load all existing staff styles

Jan Angermüller jan at angermueller.com
Wed May 11 11:02:17 CEST 2016


Jari,

I get a weird behaviour in the attached document (and some other 
documents, but not all).

Although the file has more than 40 staff styles, 
FCStaffStyleDefs:LoadAll() only loads 10 and FCStaffStyleDefs.Count also 
returns only 10. It is possible though to load the "lost" staff styles 
individually with something like FCStaffStyleDef:Load(40).
Test script below.

I have also noticed this behaviour from time to time in other documents 
that I created in the last year. Normally everything is ok with 
FCStaffStyleDefs:LoadAll(). I have no idea where it comes from. Maybe it 
even comes from JW Lua as the documents can have staff styles that were 
created automatically within JW Lua. But I am not sure if this is the 
cause of the problem and if every document that had the problem had JW 
Lua staff styles.

The attached file was exported from Finale 2014 in Finale 2014 format to 
reduce file size, but the problem occurs with the 2012 file as well as 
with the original 2014 file.

Best,
Jan

local ssdefs=finale.FCStaffStyleDefs()
ssdefs:LoadAll()
print("StaffStyles",ssdefs.Count)
local namestr=finale.FCString()
for s in each(ssdefs) do
     s:GetName(namestr)
     print(namestr.LuaString)
end

local s=finale.FCStaffStyleDef()
s:Load(44)
s:GetName(namestr)
print("Item 44:", namestr.LuaString)


Running [Unnamed Script] ======>
StaffStyles 10
Show Key Sig
01.  Slash Notation (Layer 2 included)
Hide Key Sig
07.  One-Bar Repeat
08.  Two-Bar Repeat
Hide Articulations (All Layers)
002.  Rhythmic Notation
One Bar repeat with objects
01.  Slash Notation (Layer 2 incl) without Expr
007.  One-Bar Repeat
Item 44: 015.  Note Shapes
<======= [Unnamed Script] succeeded (Processing time: 0.000 s).

-------------- next part --------------
A non-text attachment was scrubbed...
Name: staffstyledefs problem.mus
Type: application/octet-stream
Size: 45331 bytes
Desc: not available
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20160511/08becab1/attachment-0001.obj>


More information about the JWLua mailing list