AppleScript C Perl Shell Xcode Other

Forcefully quit any application in AppleScript

Post Reply
coding / applescript     Views: 4185Prev .. Next
Forcefully quit any application in AppleScriptPosted: Sunday, October 17, 2010 [15:50:13] - 1
rootPosted by:rootMember Since:
June 16 2010
Posts: 356
Sometimes for one reason or another application won't quit in AppleScript, i.e.
View Codetell application "Safari" to quit

If your script depends on quitting application -- there is a simple way of making sure application quits.
It could be any application instead of "Safari".
Shell comes to the rescue:
View Codeset quitResult to do shell script "ps axjww"
if quitResult contains "Applications/Safari" then
do shell script "killall Safari"
delay 2
end if

This way application process will be killed by underlying UnixThere's no place like ~
coding / applescriptPrev .. Next
 
Post Reply
Home - Coding: AppleScript C Perl Shell Xcode Other
Our Telegram Group