Applescript Function for When Touchbar Button is Pressed Down and When Button is Released

Hello,

I'm trying to create an Applescript for a Touchbar button that has two different functions: when the button is pressed down and when it is released. Are there any functions available to me?

If not, I'd like to request a function like on bttButtonDown() and on bttButtonUp() be open on the Applescript BTT API. Or, possibly add a GUI option for calling different Applescripts for when the Touchbar button is pressed down and when the button is released.

Thank you!

Use an Apple script widget that checks for your desired parameter and return anything. One of the returns should then toggle the alternative icon/background color that you should set.