Is it possible to program the F8 key to run Spotify instead of iTunes?
The simplest way to do this, is to set Spotify to
Open at Login.
As long as iTunes is not opened, Spotify will get priority when you hit any of the special keys.
Alternatively you can install a little helper tool. Try these instructions from the Spotify Community Forum:
Download Bubo (https://github.com/jguice/mac-bt-headset-fix#beta-version) and move application to the Applications folder
Then go into your Mac System Preferences --> Users and Groups --> Login Items -->
- Remove Itunes Helper
- Add Bubo
F8 does not start iTunes app in a regular way. It's a kind of intra-system shortcut for launching a privileged default music app in macOS, which always will be iTunes. You can set F8 for launching Spotify using Automator or third party apps, but then this key will lost its play/pause functionality.