我正在一个应该响应的程序中使用AppleScript,但似乎我在检查应用程序是否正在运行时遇到了瓶颈,这需要大约半秒\xe2\x80\xa6有没有办法减少这?
\n\n这是我目前正在做的事情:
\n\nif application "Finder" is running then\n tell application "Finder" to activate\nend if\nRun Code Online (Sandbox Code Playgroud)\n
这就是我正在使用的(在本例中为 Word),它看起来足够快(不到 0.5 秒)。结果是 Appli_Launch = true 或 false :
tell application "System Events" to set Appli_Launch to exists (processes where name is "Microsoft Word")
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3807 次 |
| 最近记录: |