The autohotkey script that pops up when you google "spotify autohotkey" broke, and that pretty much prevented me from listening at work for a week. Very annoying to not have a quick way to stop my music when a coworker taps me on the shoulder.
SetTitleMatchMode 2
IfWinExist,Spotify Premium
{
WinActivate
sleep, 100
send, {space}
}
SetTitleMatchMode 1
And alt-tab may also help, but it sometimes brings up the wrong window. F6::Media_Prev
F7::Media_Play_Pause
F8::Media_Next