Skip to content

Instantly share code, notes, and snippets.

@nikcub
Created August 20, 2012 16:43
Show Gist options
  • Save nikcub/3405672 to your computer and use it in GitHub Desktop.
Save nikcub/3405672 to your computer and use it in GitHub Desktop.
Mute Spotify Ads
--Mute Spotify when ads are playing. Use if in a country where you can't
--purchase a pro account. Open AppleScript editor (Applications > Utilities)
--paste this script in and then go File -> Save As, change 'File Format' to
--'Application' and save somewhere. Run Spotify using that application.
set currentTrack to ""
do shell script "open -a \"Spotify\""
delay 5
repeat while appIsRunning("Spotify")
tell application "Spotify"
if player state is playing then
if get sound volume > 0 then
set defVolume to sound volume
else
set defVolume to 60
end if
set currentTrack to current track
if currentTrack's name is "Spotify" then
set sound volume to 0
else
set sound volume to defVolume
end if
end if
end tell
delay 2
end repeat
on appIsRunning(appName)
tell application "System Events" to (name of processes) contains appName
end appIsRunning
@ricardoparro
Copy link

spotify got an error: Can’t get «class pPlS». (-1728). Can you help?

@paris007
Copy link

Hey, I was super excited when I saw this. Thought it would work but I am afraid it is not working anymore. Have you come up with a new script to block the ads on Spotify?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment