Triggerable conditional activation groups

touch-bar

#1

I've got a workflow where when I plug in to my external monitor, I want a "sleep display" button to show up. Currently I've achieved this using a widget that changes its icon from blank to the sleep icon when it detects 2+ displays, but when I'm unplugged that widget sometimes covers up buttons in the scrollable main container. I'd love to see a parameter in the conditional activation group pane that runs applescript like the widgets do and activates when it returns true.


#2

Hey!

As a workarround while they implement the feature, in "select touch bar widget/gesture" select run applescript
In the script at the top write "set str to "" as string" then creat an if 2+ monitors are plugged in then set str to "Sleep Display" and at the end of the script write "return str.

This will set the value of str as a name for the button, and if the button does not have a name, it is not displayed, therefor if str is "Sleep Display" (when there are 2+ displays plugged in) the button will show up, else it won't

Here is an example with a script I wrote for a "Skip Intro" button for Netflix

set str to "" as string

if ((str is equal to str) and ( application "Safari" is running)) then

tell application "Safari"

repeat with t in tabs of windows

tell t

if URL starts with "https://www.netflix.com/watch" then

set str to "Skip Intro"

end if

end tell

end repeat

end tell

else

return ""

end if

return str

I know its useless but it looks fancy :joy:


#3

basically if you return "" (nothing as text), the entire widget will hide entirley. it will go invisible.

If you return some text again it'll pop up again for you!


#7

Let's delete the clutter here! gotta keep things neat.