pibar icon indicating copy to clipboard operation
pibar copied to clipboard

Add AppleScript Support

Open amiantos opened this issue 4 years ago • 1 comments

  • it'd be nice if the ability to toggle pi-holes on and off was scriptable via AppleScript. More info here.

amiantos avatar May 19 '20 23:05 amiantos

Hey I know some of you may be like me and use your own global keyboard shortcuts. (In my case PiBars uses one I had open. But I figured I'd throw together an AppleScript for disabling by AppleScript. I have a slight delay in mine so someone smarter than me might be able to fix that but I figured I would include.

This script just Ques up the Disable Time options instead of disabling all together.

tell application "System Events" to quit
tell application "System Events" to tell process "PiBar"
	click menu bar item 1 of menu bar 2
end tell
do shell script "killall System\\ Events"
delay 0.1
tell application "System Events" to tell process "PiBar"
	tell menu bar item 1 of menu bar 2
		key code 125
		key code 76
	end tell
end tell

BrianAMartin221 avatar May 24 '20 18:05 BrianAMartin221