[JW Lua] Parsing all chord definitions ?

Jan Angermüller jan at angermueller.com
Sat Jun 27 14:59:56 CEST 2015


Jari (or anybody),

how can I create a loop over all chord suffix-definitions ?

I have:
- the FCChordSuffixElement class that holds a single character
- the FCChordSuffixElements class that holds all characters that belong 
to a chord
- the FCChord: all chords attached to the score. That doesn't cover all 
chord definitions, but only the ones used in the score.

What I am missing a "super" class that holds all FCChordSuffixElements 
classes, so that I can parse all chord definitions from the "Chord 
Suffix Selection" dialog.

Currently I use a workaround like this:

for i = 1,1000,1 do -- assuming that there are less than 1000 chord 
suffix definitions
     local cse=finale.FCChordSuffixElements()
     cse:LoadAllForItem(i)
     if cse.Count>0 then
             for c in each(cse) do
                 ..... do something with it
             end
     end
end

BUT: how do I know how many chord definitions exist ?
Assuming less than 1000 is only a workaround.
FCChordSuffixElements.Count gives the number of characters a chord 
definition uses, but not the number of all chord definitions.

Best regards,
Jan







More information about the JWLua mailing list