Jake.codes

Reload Spotify

Tuesday, February 12, 2013

If you are building a Spotify app, this is a quick and easy way to reload the app. Great for a keyboard command.

on isRunning(appName)
  tell application "System Events"
        return (count of (every process whose bundle identifier contains appName))
    end tell
end isRunning

if (isRunning("Spotify") > 0) then
    tell application "Spotify"
        quit
    end tell
end if

open location "spotify:app:YOUR-BUNDLE-INDENTIFIER"