cubb Posted November 3, 2014 Share Posted November 3, 2014 (edited) Does just what it says on the tin: toggles Bluetooth on or off depending on the current state. It's built to work with OS X Yosemite and Yosemite alone. To use, just type bt and press enter. If Bluetooth is on, it will be turned off. If Bluetooth is off, it will be turned on. The original AppleScript was written by fartheraway in response to a question on StackExchange. I just packaged it and gave it a simple icon that will work equally well on dark and light themes. Known shortcomings: - Current state (on or off) not shown - New state not shown/notified Download “Bluetooth Toggle” workflow (via CloudApp) Packal Edited November 3, 2014 by cubb Andrea 1 Link to comment
forgetfulfellow Posted October 2, 2018 Share Posted October 2, 2018 Awesome, still works :) Thanks! Link to comment
Sam Michel Posted April 1, 2019 Share Posted April 1, 2019 Very handy script, but it stopped working for me with Mac OSX Mojave. I found this alternative AppleScript which seemed to do the trick - just replaced the Run NSAppleScript section of the workflow and it works now: #!/usr/bin/osascript on alfred_script(q) tell application "System Preferences" reveal pane id "com.apple.preferences.Bluetooth" -- activate set the current pane to pane id "com.apple.preferences.Bluetooth" try tell application "System Events" to tell process "System Preferences" click button "Turn Bluetooth Off" of window "Bluetooth" click button "Turn Bluetooth Off" of sheet 1 of window "Bluetooth" of application process "System Preferences" of application "System Events" end tell delay 1 on error tell application "System Events" to tell process "System Preferences" click button "Turn Bluetooth On" of window "Bluetooth" quit end tell end try end tell end alfred_script Andrea 1 Link to comment
Vookimedlo Posted April 9, 2019 Share Posted April 9, 2019 Or this one: https://github.com/vookimedlo/alfred-adapters Link to comment
Andrea Posted November 12, 2019 Share Posted November 12, 2019 On 4/1/2019 at 3:48 PM, Sam Michel said: Very handy script, but it stopped working for me with Mac OSX Mojave. I found this alternative AppleScript which seemed to do the trick - just replaced the Run NSAppleScript section of the workflow and it works now: #!/usr/bin/osascript on alfred_script(q) tell application "System Preferences" reveal pane id "com.apple.preferences.Bluetooth" -- activate set the current pane to pane id "com.apple.preferences.Bluetooth" try tell application "System Events" to tell process "System Preferences" click button "Turn Bluetooth Off" of window "Bluetooth" click button "Turn Bluetooth Off" of sheet 1 of window "Bluetooth" of application process "System Preferences" of application "System Events" end tell delay 1 on error tell application "System Events" to tell process "System Preferences" click button "Turn Bluetooth On" of window "Bluetooth" quit end tell end try end tell end alfred_script Thanks @Sam Michel! That works perfectly! Very handy when I travel, my Magic Mouse is stowed away in some luggage and I cannot use the trackpad because my Macbook keeps trying to connect to the mouse! Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now