Automation to prevent Apple Music launching on Bluetooth disconnect?

When I use my AirPods with my Mac and disconnect them later, it automatically opens Apple Music. It’s super annoying. Has anyone figured out a way to stop this? Maybe using BTT to automatically close Apple Music when it launches after disconnecting? I even found an app that fixes this (noTunes), but I’d rather not install a third-party app just for this one issue.

That is weird behavior - something must be launching your Apple Music as this is not default behavior.

You could probably do something like this but I'd rather try to figure out why Music is launching

This is a macOS feature, and the noTunes app was developed to fix this nonsense. I will try your ‘Audio Output Device Did Change’ trigger.

this is definitely not standard macOS behavior unless I misunderstood. Why would Music open when you disconnect your Airpods? It wouldn’t even make sense on connect, but on disconnect even less (?)

It must be because coworkers are also seeing this same behavior. Basically, this happens when I’m in a Teams meeting with my AirPods. I end the meeting, take out my AirPods, and put them back in the case. Apple Music then opens automatically.