Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Toggle Bluetooth menu item
tell application "System Preferences"
set the current pane to pane "Bluetooth"
delay 1
end tell
tell application "System Events"
tell process "System Preferences"
set toggleBluetooth to the checkbox "Show Bluetooth in menu bar" of the window "Bluetooth"
click toggleBluetooth
end tell
end tell
tell application "System Preferences"
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment