Skip to content

Instantly share code, notes, and snippets.

@lardissone
Created May 8, 2020 13:11
Show Gist options
  • Save lardissone/336b413da5aa43291835c36769297f9c to your computer and use it in GitHub Desktop.
Save lardissone/336b413da5aa43291835c36769297f9c to your computer and use it in GitHub Desktop.
activate application "SystemUIServer"
tell application "System Events"
tell process "SystemUIServer"
-- Working CONNECT Script. Goes through the following:
-- Clicks on Bluetooth Menu (OSX Top Menu Bar)
-- => Clicks on SX-991 Item
-- => Clicks on Connect Item
set btMenu to (menu bar item 1 of menu bar 1 whose description contains "bluetooth")
tell btMenu
click
tell (menu item "AP-441" of menu 1)
click
if exists menu item "Connect" of menu 1 then
click menu item "Connect" of menu 1
return "Connecting..."
else
click btMenu -- Close main BT drop down if Connect wasn't present
return "Connect menu was not found, are you already connected?"
end if
end tell
end tell
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment