“AppleScript不理解”;“应用程序运行”;消息

“AppleScript不理解”;“应用程序运行”;消息,applescript,Applescript,我是AppleScript新手,正在尝试合并一个和注销VPN相关联的脚本。基本上,如果我的VPN失败或我注销,出于安全目的,我希望它关闭我的浏览器。然而,Applescript不会“理解”我在网上到处都能找到的应用程序运行检查。。。有什么想法吗 set apps to {"Firefox", "uTorrent"} repeat with thisApp in apps if ApplicationIsRunning(thisApp) then tell applicat

我是AppleScript新手,正在尝试合并一个和注销VPN相关联的脚本。基本上,如果我的VPN失败或我注销,出于安全目的,我希望它关闭我的浏览器。然而,Applescript不会“理解”我在网上到处都能找到的应用程序运行检查。。。有什么想法吗

set apps to {"Firefox", "uTorrent"}
repeat with thisApp in apps
    if ApplicationIsRunning(thisApp) then
        tell application thisApp to quit
    end if
end repeat
错误:

error "«script» doesn’t understand the “ApplicationIsRunning” message." number -1708 from «script»
尝试:

将应用程序设置为{“Firefox”,“uTorrent”}
在应用程序中重复此应用程序
如果应用程序thisApp正在运行,则
告诉应用程序thisApp退出
如果结束
结束重复

谢谢!工作得很好。