[JW Lua] Deleting groups...

Jan Angermüller jan at angermueller.com
Sun Aug 22 19:15:35 CEST 2021


When deleting from a collection class always use eachbackwards() instead 
of each() and never save the collection afterwards.
This code should work:

> if finenv.FinaleVersion >= 2011 then
>
>   groups = finale.FCGroups(0, 0)
>   groups:LoadAll()
>
>   for g in each*backwards*(groups) do
>
>     if g:GetItemID() == 18 then
>
>       g:DeleteData()
>
>     end
>   end
> end


Jan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20210822/6842ed72/attachment.html>


More information about the JWLua mailing list