[JW Lua] FCLuaIterator problem

Charles O. Lawrence charlesolawrence at bellsouth.net
Sat Dec 19 14:34:41 CET 2015


Thanks for the info.  More supported class ID's would be great.
Charles

-----Original Message-----
From: JWLua [mailto:jwlua-bounces at jwmusic.nu] On Behalf Of Jari Williamsson
Sent: Saturday, December 19, 2015 7:54 AM
To: The JW Lua script plug-in. <jwlua at jwmusic.nu>
Subject: Re: [JW Lua] FCLuaIterator problem

Charles,

That's correct. Currently, only articulations are supported by
ForEachRegionObject[Saved]. But it shouldn't crash on unsupported class IDs,
that's a bug.

I'll see if I can support some more class IDs in the next beta.


Best regards,

Jari Williamsson



On 2015-12-18 23:59, Charles O. Lawrence wrote:
> Is it because the only class ID documented is FCID_ARTICULATION?  If 
> so, can this be expanded to include all the other types of objects 
> documented in the
> ForEachObject() method?  Say yes, please.
>
> I finally got it to work with this code using the ForEachSaved() 
> method.  Is there another, better way?
>
> Sorry if the code is not formatted like it should be.  It looks good 
> before I send the email.  It's the Outlook that's munging it up, I think.
> Charles
> ----------------------------------------------------------------------
> -----
> function callback(c)
>     if c.ChordSuffixID == 27 then c.ChordSuffixID = 33 end end local 
> chords = finale.FCChords()
> chords:LoadAllForRegion(finenv.Region())
> local iterator = finale.FCLuaIterator()
> print(iterator:ForEachSaved(chords,callback))
>
> -----Original Message-----
> From: JWLua [mailto:jwlua-bounces at jwmusic.nu] On Behalf Of Charles O.
> Lawrence
> Sent: Thursday, December 17, 2015 11:38 AM
> To: 'The JW Lua script plug-in.' <jwlua at jwmusic.nu>
> Subject: [JW Lua] FCLuaIterator problem
>
> Jari,
>
> The following code always crashes Finale hard, so that a reboot is 
> usually necessary to get any control back.
>
> Am I missing something, or is there a problem with the iterator?
>
> I am trying to "improve" on the working code of HaraldS by replacing 
> the "deprecated" for..each()..do..end code with the newer FCLuaIterator().
>
> Thanks,
> Charles
>
> ----------------------------------------------------------------------
> --
> function callback(c)
>     if c.ChordSuffixID == 27 then c.ChordSuffixID = 33 end end local 
> iterator = finale.FCLuaIterator() 
> iterator:ForEachRegionObjectSaved(finenv.Region(),finale.FCID_CHORD,ca
> llback
> )
>
> --[[ original code by HaraldS
> local chords = finale.FCChords()
> local n = chords:LoadAllForRegion(finenv.Region())
> for c in each(chords) do
>     if c.ChordSuffixID == 27 then c.ChordSuffixID = 33 end end
> chords:SaveAll()
> --]]
>
>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>
>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>
>



_______________________________________________
JWLua mailing list
JWLua at jwmusic.nu
http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu





More information about the JWLua mailing list