Force update on button click


I have created a simple button to add a song to favorites. The button display a full or empty heart depending if the track is loved or not.

The refresh rate of the button is set to 5s.

So when I click on the button, I need to wait 5s before the button actually updates.

That would be cool if there was an option to trigger a new run of the script that manages the display of the button after x seconds of delay when I click the button.

So I could use rather long refresh rate and have immediate feedback of the button action.


You can either assign the predefined action "Run Apple Script" and enter the same Apple Script you use for the widget, or you can use the "update_touch_bar_widget" apple script function:

Awesome !

Didn't see the apple script API of BTT !

Works like a charm.

1 Like