Guest User

Untitled

a guest
Oct 18th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. tell application "System Events" to tell process "SystemUIServer"
  2. set bt to (first menu bar item whose description is "bluetooth") of menu bar 1
  3. click bt
  4. tell (first menu item whose title contains "AirPods") of menu of bt
  5. click
  6. tell menu 1
  7. if exists menu item "Connect"
  8. click menu item "Connect"
  9. return "Connecting..."
  10. else
  11. click bt -- close main dropdown to clean up after ourselves
  12. return "No connect button; is it already connected?"
  13. end if
  14. end tell
  15. end tell
  16. end tell
Add Comment
Please, Sign In to add comment