Skip to content

Instantly share code, notes, and snippets.

@davidverweij
Last active June 15, 2021 16:41
Show Gist options
  • Save davidverweij/2b96708748a1d3b08c364a9d052c79aa to your computer and use it in GitHub Desktop.
Save davidverweij/2b96708748a1d3b08c364a9d052c79aa to your computer and use it in GitHub Desktop.
Turn Bluetooth on/off - quick action for Apple Touch Bar
(* Open Automator, add quick action, run AppleScript and paste this AppleScript. Specific 'button' and 'window' might differ per MacOS. I'm on 10.15.7 *)
on run {input, parameters}
tell application "System Preferences"
reveal pane "com.apple.preferences.Bluetooth"
end tell
tell application "System Events" to tell process "System Preferences"
click button 3 of window 1
end tell
return input
quit application "System Preferences"
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment