[JW Lua] Deleting groups...

Simon Leclerc simon at prodsl.ca
Sun Aug 22 20:09:30 CEST 2021


It does work, Jan. Thank you!

And you’re right to remind me of the backward approach when deleting. Important factor.

I have another question regarding this:

When the group is deleted, if I use the command “Reset all groups & Brackets”, the group re-appears.
There must be a class somewhere telling Finale that by defaut, those staves should be grouped.
It does not seem to be part of the FCStaff class.

Any idea which one?



¯\_(ツ)_/¯

Simon Leclerc





> On August 22, 2021, at 13:15, Jan Angermüller <jan at angermueller.com> wrote:
> 
> 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 eachbackwards(groups) do
>> 
>>     if g:GetItemID() == 18 then
>> 
>>       g:DeleteData()
>> 
>>     end
>>   end
>> end
> 
> 
> Jan
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu

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


More information about the JWLua mailing list