I'm often switching between Spotify and Music.app and find that what Mac targets when using pause media key can sometimes be unpredictable. This little script will pause either if playing.
Open pause-any-music in Script Kit
// Name: Pause Any Music// Description: Pause music playing from music apps// Author: Josh Davenport-Smith// Twitter: @joshdprts import "@johnlindquist/kit"; const pauseScript = `tell application "Spotify" pauseend tell tell application "Music" pauseend tell`; exec(`osascript -e '${pauseScript}'`);