Two State button tutorial

Please, could someone make a tutorial explaining Two State button?

29

Why some buttons have it and others don't.

That is what I need to know.

What do you mean by two state button? The closest thing I use is AppleScript widgets with two icons based on a script's return value. If that's what you're looking for, check out my post here for the AppleScript:

For Free? Please explain fully what you are asking for.

These buttons only appear to be buttons. But actually they are textless widgets ("Show only icon, no text").


In a regular, given interval, they run an apple script or a Shell script to check wether certain parameters are fulfilled, and depending on what they find return a result (Return 1) or another (Return 2).

Feg, lets make a button that gets a blue Background as soon as Safari is running (either in the first plan or in the background).

if application "Safari" is running
   return "Running"
else
   return "Quit"
end if

This Apple Script just checks wether the Application "Safari" is active or not.

Next you would set the "Alternate Color Regrex" to "Running". This means that if the script returns "Running", the widget (or button) will display the other background color, or even its own icon.

Now check the "Common" tab of the widget, choose an alternate Background color (the one you want to see if Safari is running) and set an alternate icon if you'd like it to change.


Voilà.

To sum up: These "Two State buttons" aren't buttons but widgets, that search for certain given parameters in a regular interval and use the "Alternate Color Regrex" provided by BTT to change their color.
At least the easier ones. You can also achieve to change a widgets color introducing the program BetterTouchTool into the script itself, but that's a little more complicated for novices.

1 Like

thank you.

Imprint | Privacy Policy