AppleShinja

Test AirPods Pro

Dec 17th, 2019
1,335
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. activate application "SystemUIServer"
  2. tell application "System Events"
  3. tell process "SystemUIServer"
  4. -- Working CONNECT Script. Goes through the following:
  5. -- Clicks on Bluetooth Menu (OSX Top Menu Bar)
  6. -- => Clicks on Woz’s AirPods Pro Item
  7. -- => Clicks on Connect Item
  8. set btMenu to (menu bar item 1 of menu bar 1 whose description contains "bluetooth")
  9. tell btMenu
  10. click
  11. tell (menu item "Woz’s AirPods Pro" of menu 1)
  12. click
  13. if exists menu item "接続" of menu 1 then
  14. click menu item "接続" of menu 1
  15. return "Connecting..."
  16. else
  17. click btMenu -- Close main BT drop down if Connect wasn't present
  18. return "Connect menu was not found, are you already connected?"
  19. end if
  20. end tell
  21. end tell
  22. end tell
  23. end tell
RAW Paste Data