To open Spotify and play a song on launch you could do this in AppleScript:
tell application "Spotify"
activate
play track "spotify:track:trackURI"
end tell
Export this script as an Application with the option "Save as executable script" (or something similar).
Then, to map your f8 key to this script, go to System Preferences, and then under "Keyboard" enable "Use All F1, F2, etc, keys as standard function keys". For the next step, you need to switch to the "Keyboard Shortcuts" tab and add a new Keyboard Shorcut under Applications that will open the AppleScript. (If I remember correctly, you have to reboot your computer or log out for the changes to take place)
1@Lri my question is not a duplicate. I want to know how to make it open Spotify, not just how to keep it from opening iTunes. – Wuffers – 2011-11-18T11:16:27.513