I found someone elses script (knowing nothing about scripting myself) that accomplishes this perfectly except that every so often it returns a "unable to turn bluetooth off" error, even though it does anyway. It mainly seems to happen when I run it for the first time after booting up. Can someone who knows what they're doing help me tweak the script and get rid of this annoying error?
Here's what I've got at the moment (requires this small utility by the way)
set bt_status to do shell script "/usr/local/bin/blueutil 'status'"
if bt_status is "Status: off" then
do shell script "/usr/local/bin/blueutil 'on' "
else
do shell script "/usr/local/bin/blueutil 'off' "
end if
Thanks for any help!
Here's what I've got at the moment (requires this small utility by the way)
set bt_status to do shell script "/usr/local/bin/blueutil 'status'"
if bt_status is "Status: off" then
do shell script "/usr/local/bin/blueutil 'on' "
else
do shell script "/usr/local/bin/blueutil 'off' "
end if
Thanks for any help!