[ad_1]
I am trying to make a zsh function that I can pass an argument to in order to quit a given app using the terminal in the same way that the app quits with the <CMD,Q> shortcut (so not just pkill
).
I used the example of how to quit apps in macOS terminal from here and I confirmed that my Zsh function/argument use syntax seems correct from looking at this question and this documentation
quitapp() {
osascript -e 'quit app ${1:?"The application must be specified."}'
}
However, I tested it by trying to quit Spotify but when I tried to do so like this:
quitapp Spotify
I got this error:
9:10: syntax error: Expected expression, property or key form, etc. but found unknown token. (-2741)
(I tried using both lowercase and uppercase, and tried to enclose Spotify in double quotes or without double quotes, and always the same error).
What am I doing wrong?
[ad_2]