Spotify continues playing on my Mac when my bluetooth headphones are disconnected (when they go out of range or lose battery for example). I have an AppleScript to pause Spotify, and I want it to be run upon the bluetooth device disconnecting. How can I detect when the bluetooth headphones are disconnected?
1 Answer
system_profiler SPBluetoothDataType
can check you bluetooth status.
There will be connection parameters Connected: Yes or No
-
is there a way to parse the output? I see list of information is showing, it doesn't look like an XML or JSON. Commented Apr 16, 2022 at 13:28
-