Use this/self trigger in scripts


How do I get the UUID of the pressed button?

Or more generally, how do I get the self or this object? I'd like to read the button's name and use it within the script of that trigger.

Right Click on the Button.

@Caliguvara - I am looking to programmatically get the pressed button's UUID (or object), not via the GUI.


buttonName = JSON.parse(BetterTouchTool.get_trigger("C9342C15-4E83-45DB-9CF0-5147C356622C"))["BTTTouchBarButtonName"]

That is the ID of the button that I'm actually pressing. I want to get that UUID programatically.

there is currently no way to do this because actions in BTT are not aware of their triggers. I’ll think about it, but not sure whether this can be changed.

1 Like

Ah ok - I'll have to hardcode everything in then :slight_smile: