Applescript open URL and refresh every 5 seconds WITHOUT opening new tab

时间:2015-09-01 21:17:56

标签: google-chrome applescript refresh

This is what I have so far but my problem is it opens the url in a new tab after every 5 seconds.

repeat
    delay 5
    tell application "Google Chrome"
        open location "https://www.google.com"
    end tell
end repeat

2 个答案:

答案 0 :(得分:2)

Chromium Suite中有一个reload命令。

示例:

tell application "Google Chrome"
    activate
    open location "https://www.google.com"
    repeat
        delay 5
        tell tab 1 of window 1 to reload
    end repeat
end tell

答案 1 :(得分:0)

这对我有用......

tell application "Google Chrome"
    tell window 1
        tell tab 1
            set URL to "https://google.com/"
        end tell
    end tell
end tell

您还可以使用tell active tabtell front window