“退出”的替代方案命令
我知道问题标题看起来很奇怪,所以我会尝试更好地解释它:我知道您可以通过这样做使应用程序退出:
tell application "whatever" to quit
我想知道是否有任何替代方法可以这样做。
提前致谢。
I know the question title looks weird so I'll try to explain it better: I know you can make applications quit by doing this:
tell application "whatever" to quit
I want to know if there are any alternatives to doing this.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以像这样使用
GUI Scripting
...You could use
GUI Scripting
like this...告诉应用程序“无论如何”退出
方法的问题是,您只能定位在编译脚本时安装在计算机上的应用程序。这是一个 AppleScript,它确定所有正在运行的应用程序进程的名称,然后通过向其发送quit
命令来退出每个进程。The problem with the
tell application "whatever" to quit
approach is that you can only target applications that are installed on your machine upon compilation of the script. Here's an AppleScript that determines the names of all running application processes and then quits each one by sending it thequit
command.