0

我正在尝试使用以下代码退出所有活动浏览器,但无法获取要退出的所有活动浏览器的列表,我尝试了以下代码...请建议..

tell application "System Events"

    set appList to every process whose visible is true

    repeat with thisApp in appList
        tell process browser
            quit
        end tell
    end repeat
end tell
4

1 回答 1

0

您不能退出“进程”,只能退出“应用程序”。此外,您必须完成所有可能的浏览器名称的 browserList。

set browserList to {"Safari", "Firefox"}

tell application "System Events"
    set appList to name of every process whose visible is true
end tell

repeat with i from 1 to count of appList
    set thisApp to item i of appList
    if thisApp is in browserList then
        tell application thisApp to quit
    end if
end repeat
于 2012-12-03T10:47:55.443 回答