Last active
April 6, 2018 14:55
-
-
Save andywirv/44065c5768b69b57c19b0b086e0c913c to your computer and use it in GitHub Desktop.
Spotify Rick Roll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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