Created
October 3, 2021 06:57
-
-
Save Fusion/9d666f49e5dd1a140c2916efd29cfa3d to your computer and use it in GitHub Desktop.
Cycling Bluetooth off and off: workaround for capricious keyboard on Mac M1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "System Preferences" | |
reveal pane id "com.apple.preferences.Bluetooth" | |
activate | |
tell application "System Events" to tell process "System Preferences" | |
display notification "Turning Bluetooth off and then back on." with title "Bluetooth" subtitle "Hopefully this fixes any keyboard issue." sound name "Frog" | |
click button "Turn Bluetooth Off" of window "Bluetooth" of application process "System Preferences" of application "System Events" | |
delay 5 | |
click button "Turn Bluetooth On" of window "Bluetooth" of application process "System Preferences" of application "System Events" | |
end tell | |
quit | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment