Created
July 1, 2021 12:19
-
-
Save hsz/489f3c9d17ee5e0dd7279b473da93d9f to your computer and use it in GitHub Desktop.
Play/pause Spotify with no iTunes action hijacking
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 is_running(appName) | |
tell application "System Events" to (name of processes) contains appName | |
end is_running | |
if is_running("Spotify") then | |
tell application "Spotify" to playpause | |
else | |
tell application "Spotify" | |
activate | |
play | |
end tell | |
tell application "Finder" to set visible of process "Spotify" to false | |
end if |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment