Applescript 打开 URL 并每 5 秒刷新一次而不打开新标签
Applescript open URL and refresh every 5 seconds WITHOUT opening new tab
这是我目前所拥有的,但我的问题是它每隔 5 秒就会在新标签页中打开 url。
repeat
delay 5
tell application "Google Chrome"
open location "https://www.google.com"
end tell
end repeat
这对我有用...
tell application "Google Chrome"
tell window 1
tell tab 1
set URL to "https://google.com/"
end tell
end tell
end tell
您还可以使用 tell active tab
和 tell front window
。
Chromium 套件中有一个 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
这是我目前所拥有的,但我的问题是它每隔 5 秒就会在新标签页中打开 url。
repeat
delay 5
tell application "Google Chrome"
open location "https://www.google.com"
end tell
end repeat
这对我有用...
tell application "Google Chrome"
tell window 1
tell tab 1
set URL to "https://google.com/"
end tell
end tell
end tell
您还可以使用 tell active tab
和 tell front window
。
Chromium 套件中有一个 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