[JW Lua] Deleting groups...

Simon Leclerc simon at prodsl.ca
Sun Aug 22 19:57:43 CEST 2021


Thanks Robert.

The “GetItemID” works fine when invoked.
I’ll try what you suggest.





¯\_(ツ)_/¯

Simon Leclerc
60, Mirabelle
Ste-Agathe-des-Monts, Québec
J8C 0W9
simon at prodsl.ca




> On August 22, 2021, at 12:50, Robert Patterson <robert at robertgpatterson.com> wrote:
> 
> 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 <mailto: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 <mailto: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 <mailto:JWLua at jwmusic.nu>
> http://jwmusic.nu/mailman/listinfo/jwlua_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

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


More information about the JWLua mailing list