[JW Lua] Deleting groups...

Robert Patterson robert at robertgpatterson.com
Sun Aug 22 18:50:50 CEST 2021


Also "GetItemID" is probably always 0. (I think it's a holdover from
pre-2011 groups.) There's another value you need to compare with.

On Sun, Aug 22, 2021 at 11:48 AM Robert Patterson <
robert at robertgpatterson.com> wrote:

> Try not passing parameters to the FCGroups constructor. The code in this
> script
> <https://github.com/Nick-Mazuk/jw-lua-scripts/blob/master/src/staff_groups_reset.lua>
> works.
>
> On Sun, Aug 22, 2021 at 10:23 AM Simon Leclerc <simon at prodsl.ca> wrote:
>
>> Hi to all,
>>
>> I’m trying to delete a group and it does not seem to work.
>> I can edit the parameters fine but impossible to delete it.
>>
>> Am I missing something? Another class that needs to be updated for it to
>> take effect?
>>
>> Thanks for any input :)
>>
>>
>> if finenv.FinaleVersion >= 2011 then
>>
>>   groups = finale.FCGroups(0, 0)
>>   groups:LoadAll()
>>
>>   for g in each(groups) do
>>
>>     if g:GetItemID() == 18 then
>>
>>       g:DeleteData()
>>
>>     end
>>   end
>>
>>   groups:SaveAll()
>> end
>>
>>
>>
>>
>>
>> ¯\_(ツ)_/¯
>>
>> Simon Leclerc
>>
>> _______________________________________________
>> 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/0089ea6b/attachment.htm>


More information about the JWLua mailing list