Hey guys,
I was messing around last night with some of the applescript capabilities for Spotify and was able to come up with a nice little solution for automatically detecting and muting ads in the free version of Spotify. I think I was able to write it in the most efficient way where it's not polling Spotify every second, only when it needs to. Let me know what you think.
Here's the applescript code:
Here's a link to the compiled app ready to go: http://bit.ly/NBCG8A
I was messing around last night with some of the applescript capabilities for Spotify and was able to come up with a nice little solution for automatically detecting and muting ads in the free version of Spotify. I think I was able to write it in the most efficient way where it's not polling Spotify every second, only when it needs to. Let me know what you think.
Here's the applescript code:
Code:
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
Here's a link to the compiled app ready to go: http://bit.ly/NBCG8A