Can I change the default app that opens when I hit play?
Finally got to try this on a Mac with that kind of keyboard (iMac). For me, the Play/Pause key plays whatever app (iTunes or Spotify) was last playing. If neither are opened, neither will launch, so the key doesn't default to iTunes for me.
I installed Karabiner, as linked in the question. I couldn't see how to create the steps shown in that link, but if you want to get into customizing that app, I'm sure it would work. Looks pretty powerful.
But, this gets you pretty close?.. I followed the top-rated answer at https://apple.stackexchange.com/questions/175215/how-do-i-assign-a-keyboard-shortcut-to-an-applescript-i-wrote and created an Automator app running a simple Applescript:
tell application "Spotify"
activate
playpause
end tell
I couldn't get my Mac to run the Automator service through a keyboard shortcut. So, instead, I fell back to my favorite free third-party keyboard/shortcut tool, QUicksilver. There's a ton more like that, though, so take your pick.
It was pretty easy to bind a shortcut key to the AppleScript itself (didn't need the Automator Service for this), except it wouldn't let me pick the "real" Play/Pause key, only F8 (press Fn key and press F8/PlayPause key).
But, with this AppleScript, pressing F8 does launch and play/pause Spotify! If Spotify was closed, it will launch, but it will "miss" the play command. So just press F8 again.
Feel free to tweak the AppleScript to be more aware of it Spotify is running or not. Shouldn't be too hard to do, but then again, it's not too hard to press F8 twice if it wasn't running either...
You can install Better Touch Tool and set that configuration as below. Works perfect. Easiest way to achieve that requirement.
Set spotify as default player using better touch tool