Dynamically Creating Touch Bar triggers; some requests

I've been noodling around with dynamically creating touch bar triggers, partly for the purposes on modifying buttons on the fly - toggling button colours, radio type button sets where only one button is highlighted, show/hide or renaming buttons under particular conditions - and partly because setting up buttons and groups is a lot easier for some end users if done programmatically from, say, a config file or a browser. I create triggers using Python in an After Launching trigger, store UUIDs as BTT variables which I can pull later for whatever. This works well up to a point and it's powerful but in a couple of places, particularly around button groups, I've hit walls, so thought I'd post some requests in the hope that I might be able to take this further some time in the future:

  • Adding a group button using the add_trigger method returns only the uuid of the group. There appears to be no way to grab uuids of any trigger contained in the group when it's created or any time post creation. Can the method also return an array of child triggers or can there be a method for fetching child triggers. Or see below on fetching a trigger's JSON

  • A scriptable method to fetch the JSON of a trigger given its uuid. Currently, I'm storing the JSON I use to create a trigger as a temporary BTT variable. Pulling it from the actual trigger would be more useful.

  • Ability to create a trigger within a CAG or to move a trigger to a CAG. At the moment add_trigger only allows for creating triggers within the default All Apps CAG.

  • (bug?): using the update_trigger method to update a group, any triggers contained in the group end up in the root of the CAG that contains the group. If I could get the UUIDs of child triggers when I create the group, or if I could retrieve the group's JSON programmatically, I could delete them myself. Alternatively, or additionally, if there's a 'BTTAdditionalActions' list in the updating JSON maybe it should just replace the existing one and delete the group's child triggers.

  • A way to get the UUID and/or JSON of a trigger from withing that trigger's script action.

  • Can there be a version of the After Launching on Mac with Serial Number trigger that doesn't need a serial number, just triggers on any Mac.

One more:

  • a method for deleting a BTT variable.