Skip to content

Instantly share code, notes, and snippets.

View akellbl4's full-sized avatar

Paul akellbl4

View GitHub Profile
@akellbl4
akellbl4 / bluetooth_headphones.scpt
Created June 29, 2018 15:30 — forked from kevinjalbert/bluetooth_headphones.scpt
AppleScript to connect bluetooth headphones and show its battery level
activate application "SystemUIServer"
set deviceName to "Pavels's BeatsX"
tell application "System Events"
tell process "SystemUIServer"
set bluetoothMenu to (menu bar item 1 of menu bar 1 whose description contains "bluetooth")
tell bluetoothMenu
click
set deviceMenuItem to (menu item deviceName of menu 1)