"The audio output device changes." working for Bluetooth?

My Mac (10.13.2) drives me nuts always hijacking my Bluetooth headset when I want to use it with my iPhone when in another room.

My general idea was to have a macro which sets a global variable BluetoothAllowed = true (or something similar) and run this when I actually want the headset to connect. When somewhere else BluetoothAllowed would be false and I want to run some AppleScript to disconnect from the headset.

It seems, however, that the script is not triggered when a Bluetooth headset is connected. It works for a normal headset with a jack.

Any ideas?

Regards
Geir

Attached a macro just with the trigger and the applescript, which works fine when run manuallySony headset connect:reject.kmmacros (2.1 KB)
.

Hi - I’m also seeing the same issue i.e. “the audio output device changes” trigger doesn’t work when a Bluetooth headset is connected. It would be great if this could be looked at.

Thanks,
Gordon

I don’t have any bluetooth headphones to test with, but the code listens for changes to kAudioHardwarePropertyDefaultOutputDevice, so I guess either that isn’t changing, or once it changes, it is not possible to get the output device.

It is pretty hard for me to do much about this without test hardware I’m afraid.