Why does OSX always print ApplePersistence=YES to stderr?
The error message is printed to STDERR. You can simply redirect the output to /dev/null:

osascript -e 'tell application id "com.spotify.client" to quit' 2&gt;/dev/null