Get UUIDS of triggers/buttons in touchbar group by touchbar group name

I would love to be able to systematically update and/or delete buttons in a given group using javascript. But to do this you need the UUIDs of the buttons in a group. It would be great if you could retrieve all the button UUIDs in a group by providing a group name. This would allow for true modular touch bar folders and easy generalisation.

Hope it makes sense. Thank you in advance!