Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Similar thing, with a more general script' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Similar thing, with a more general script
Authored by: ZZamboni on Jun 15, '04 01:57:06PM
I have written a script called "quit":

#!/bin/sh
osascript -e "tell application \"$1\" to quit"
This uses its first argument as the name of the application. Save this somewhere in you $PATH ($HOME/bin/quit, for example), make it executable (chmod a+rx $HOME/bin/quit) and then you can quit most Applescriptable applications:
quit Mail
quit iTunes
etc.

[ Reply to This | # ]
Similar thing, with a more general script
Authored by: Dale Mox on Jun 15, '04 05:40:26PM

Correction:

#!/bin/sh
osascript -e "tell application \"$1\" to quit"



[ Reply to This | # ]
Similar thing, with a more general script
Authored by: craig on Jun 15, '04 05:40:37PM

This doesn't work for me. When I enter "quit TextEdit," I get the following error:

17:25: execution error: The variable TextEdit is not defined. (-2753)



[ Reply to This | # ]
Similar thing, with a more general script
Authored by: craig on Jun 15, '04 05:42:10PM

Thanks for the correction. Now it works.



[ Reply to This | # ]