Pause any music - only looks at Spotify/ but customisable

I'm often switching between Spotify and 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"
end tell
tell application "Music"
end tell
exec(`osascript -e '${pauseScript}'`);