开发者

Quit an application using AppleScript

开发者 https://www.devze.com 2023-01-23 02:50 出处:网络
Whenever I try to quit an application using AppleScript I get the following error An error of type -9874 has occurred.

Whenever I try to quit an application using AppleScript I get the following error

An error of type -9874 has occurred.

The AppleScript command which I am using is

tell application "app_name"
    quit
end tel开发者_开发技巧l


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

tell application "Activity Monitor"
    quit
end tell

This works fine for me - if it works OK for you then the problem is probably with your specific application. If it doesn't work for you then you have some kind of system-related problem - try it on a different Mac to verify ?

0

精彩评论

暂无评论...
验证码 换一张
取 消