Created
May 7, 2014 07:25
-
-
Save j6s/2cc690fd6877f1eae80c to your computer and use it in GitHub Desktop.
Mutes Spotify when Ads are playing
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
repeat | |
tell application "Spotify" | |
set cur_vol to sound volume | |
set trackk to track number of current track | |
set namme to name of current track | |
set pop to popularity of current track | |
set dur to duration of current track | |
set pos to player position | |
end tell | |
if pop is 0 and dur is less than 31 then | |
tell application "Spotify" | |
pause | |
set sound volume to 0 | |
play | |
end tell | |
delay dur - pos + 1 | |
tell application "Spotify" | |
set sound volume to cur_vol | |
end tell | |
else | |
if dur - pos is less than 30 then | |
delay dur - pos | |
else | |
delay 30 | |
end if | |
end if | |
end repeat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment