Close the application using AppleScript

Whenever I try to exit the application using AppleScript, I get the following error

An error of type -9874 has occurred.

The AppleScript command I use:

tell application "app_name" quit end tell 
+7
applescript exit macos quit
source share
1 answer

Are you sure that "app_name" exists? If it exists, are you sure it knows how to respond to AppleEvents ("AppleEvent-aware")? Try the following test - run Activity Monitor (in /Applications/Utilities ) and run this script:

 tell application "Activity Monitor" quit end tell 

This works fine for me - if it works fine for you, then the problem is probably related to your specific application. If this does not work for you, you have some kind of system problem - try it on another Mac to check?

+19
source share

All Articles