Created
May 17, 2020 01:00
-
-
Save milesrichardson/3c998141fe00ae3df83ff3193fe39ab9 to your computer and use it in GitHub Desktop.
"Spotify cannot play the current song" - So restart it! (restart spotify from mac command line)
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
#!/usr/bin/env bash | |
# I got sick of constantly getting the error from spotify that it cannot play | |
# the current song. It was really annoying to have to quit, open spotlight, | |
# Type "spot" and accidentally open spotlight system preferences, wait for spotify | |
# to open, etc... | |
# This script, on a mac, uses osascript to quit and relaunch spotify and press play | |
osascript -e 'tell application "Spotify" to quit' | |
osascript <<'EOF' | |
repeat until application "Spotify" is not running | |
delay 1 | |
end repeat | |
EOF | |
open -a Spotify | |
osascript <<'EOF' | |
repeat until application "Spotify" is running | |
delay 1 | |
end repeat | |
EOF | |
osascript -e 'tell application "Spotify" to playpause' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment