Widget Question: What is Execute script every....

I setup a touch bar trigger and added Apple Script / JavaScript Widget. There is then a setting for "Execute script every ... seconds" What does this do?

I thought I'd check for the status of my AppleScript, but instead it seems to make my button disappear. If it's set at 5, my button disappears after 5 seconds. If it set it to 2000, then it works fine until I hit 33 minutes which then it disappears.

To be clear, I don't have any Apple Scripts in this widget at the top level, instead I have it set in the action. Hopefully that make sense.

I'm new to AppleScript and creating custom widgets in BTT, however, what I have works, but also seems like I'm not doing something right.

It will run the script assigned to the Touch Bar Widget (not any action script) and update the Touch Bar button based on the return value. If you return nothing / an empty string the widget will be hidden.

So if I'm running a script in an action, then I don't need to worry about the "Execute script every..." in the widget setting right? I can set it to 0 and just ignore it? Seem to work.

In that case a normal Touch Bar button would be better suited though because the script widgets always have a little bit of overhead (not much, but if it's easy to switch I'd do it)

A normal Touch Bar button won't allow me to have an "Alternate Color Regex" right? I'm going to writeup what I have going on and then you can tell me if there is a better way to do it.

I appreciate all the advice.

1 Like