Is it possible to set Spotify as the default program when the "media" keys (play, pause, previous, next, etc) are pressed on the Mac keyboard?
For the most part when Spotify is open, the "media" keys work fine. But every once and a while iTunes will pop up when you hit them. It'd be a lot nicer if you could just specify that Spotify is the default program when these keys are triggered, as oppose to iTunes.
If it matters, I'm using Mountain Lion.
Best Answer
The software Beardedspice provides a user-friendly approach to prioritizing Spotify for your media keys. It runs in the background and gives you a few simple settings in the Mac menu bar. It just works.
Download and installation
It can be downloaded and installed directly from the Beardedspice homepage, or by using e.g. Homebrew:
Notes
Update 2021-01-16 - Use Beardedspice as the alternative app Mac Media Key Forwarder is no longer being updated
As there are reports of Mac Media Key Forwarder not working for some users, and the developer no longer updating the app, it is recommended to use Beardedspice.
Nevertheless, Mac Media Key Forwarder will still work fine for most people running on e.g. MacOS High Sierra, Mojave, Catalina, or Big Sur so it remains an alternative.
Download and installation
It can be downloaded and installed directly from GitHub, or by using e.g. Homebrew: