我是AppleScript的新手,并尝试合并一个与我的VPN注销相关的脚本。基本上,如果我的VPN出现故障或我退出,我希望它出于安全目的关闭浏览器。但是,Applescript不会“理解”我在网上随处可见的ApplicationIsRunning支票......有什么想法吗?
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»
答案 0 :(得分:1)
尝试:
set apps to {"Firefox", "uTorrent"}
repeat with thisApp in apps
if application thisApp is running then
tell application thisApp to quit
end if
end repeat