Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 contains "AirPods") of menu of bt
- click
- tell menu 1
- if exists menu item "Connect"
- click menu item "Connect"
- return "Connecting..."
- else
- click bt -- close main dropdown to clean up after ourselves
- return "No connect button; is it already connected?"
- end if
- end tell
- end tell
- end tell
Add Comment
Please, Sign In to add comment