Skip to content

Instantly share code, notes, and snippets.

@andywirv
Last active April 6, 2018 14:55
Show Gist options
  • Save andywirv/44065c5768b69b57c19b0b086e0c913c to your computer and use it in GitHub Desktop.
Save andywirv/44065c5768b69b57c19b0b086e0c913c to your computer and use it in GitHub Desktop.
Spotify Rick Roll
on ApplicationIsRunning(appName)
tell application "System Events" to set appNameIsRunning to exists (processes where name is appName)
return appNameIsRunning
end ApplicationIsRunning
repeat
if ApplicationIsRunning("Spotify") then
tell application "Spotify"
try
if player state is playing and player position is greater than 30 and track is not "spotify:track:4uLU6hMCjMI75M1A2tKUQC" then
play track "spotify:track:4uLU6hMCjMI75M1A2tKUQC"
end if
end try
end tell
end if
end repeat
-- curl https://gist.githubusercontent.com/andywirv/[version]/rollme.scpt | osascript
-- ctrl+z
-- bg
-- disown -h %1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment