Skip to content

Instantly share code, notes, and snippets.

@cdpath
Created September 8, 2017 15:29
Show Gist options
  • Select an option

  • Save cdpath/c8220e2da7ab1e5c57ce2807b1223d14 to your computer and use it in GitHub Desktop.

Select an option

Save cdpath/c8220e2da7ab1e5c57ce2807b1223d14 to your computer and use it in GitHub Desktop.
AppleScripts
-- credit
-- https://medium.com/@igloude/using-applescript-and-btt-to-make-the-airpods-experience-a-little-bit-better-6e78b12d33bd
tell application "System Events" to tell process "SystemUIServer"
set bt to (first menu bar item whose description is "bluetooth") of menu bar 1
click bt
tell (first menu item whose title is "YOUR_DEVICE_NAME") of menu of bt
click
tell menu 1
if exists menu item "Connect" then
click menu item "Connect"
else
click bt
end if
end tell
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment