Skip to content

Instantly share code, notes, and snippets.

@jimmythai
Created December 28, 2019 05:43
Show Gist options
  • Save jimmythai/18c4f7daa30080b1e9bdae7063d4813d to your computer and use it in GitHub Desktop.
Save jimmythai/18c4f7daa30080b1e9bdae7063d4813d to your computer and use it in GitHub Desktop.
Open System Preferences -> Bluetooth -> Toggle the Bluetooth on/off switch
tell application "System Preferences"
reveal pane "com.apple.preferences.Bluetooth"
end tell
clickBluetoothSwitch()
delay 2
clickBluetoothSwitch()
quit application "System Preferences"
on clickBluetoothSwitch()
tell application "System Events" to tell process "System Preferences"
click button 3 of window 1
end tell
end clickBluetoothSwitch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment