使用 AppleScript 退出应用程序
每当我尝试使用 AppleScript 退出应用程序时,都会收到以下错误
发生了 -9874 类型的错误。
我正在使用的 AppleScript 命令是
tell application "app_name"
quit
end tell
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 tell
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您确定“app_name”存在吗?如果它确实存在,您确定它知道如何响应AppleEvents(是“AppleEvent-aware”)吗?尝试以下测试 - 启动
Activity Monitor
(在/Applications/Utilities
中)并运行此脚本:这对我来说效果很好 - 如果它对你来说工作正常,那么问题是可能与您的具体应用有关。如果它对您不起作用,那么您遇到了某种与系统相关的问题 - 在不同的 Mac 上尝试进行验证?
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: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 ?