使用 AppleScript 重新加载特定页面的所有 chrome 个选项卡
Reload all chrome tabs of a certain page with AppleScript
我正在尝试重新加载某个页面的 Chrome(我可以打开很多 windows)的所有选项卡。这就是我所做的:
tell application "Google Chrome"
set {ids} to every window
repeat with id in ids
reload (tabs of window id whose URL contains "mypage.com")
end repeat
end tell
但是我得到了Google Chrome got an error: Can’t make item 1 of window id 1 into type integer.
我该怎么做?
这对使用最新版本的 macOS Mojave 和 Chrome 的我很有用。
tell application "Google Chrome" to set allTabs to a reference to (tabs of windows whose URL contains "mypage.com")
tell application "Google Chrome" to reload allTabs
如果有Chromewindows打开不[,@wch1zpink提交的答案将不起作用 包含至少一个带有 mypage.com
URL 的标签。不幸的是,您需要遍历 windows:
tell application "Google Chrome" to repeat with W in windows
reload (every tab in W whose URL contains "mypage.com")
end repeat
我正在尝试重新加载某个页面的 Chrome(我可以打开很多 windows)的所有选项卡。这就是我所做的:
tell application "Google Chrome"
set {ids} to every window
repeat with id in ids
reload (tabs of window id whose URL contains "mypage.com")
end repeat
end tell
但是我得到了Google Chrome got an error: Can’t make item 1 of window id 1 into type integer.
我该怎么做?
这对使用最新版本的 macOS Mojave 和 Chrome 的我很有用。
tell application "Google Chrome" to set allTabs to a reference to (tabs of windows whose URL contains "mypage.com")
tell application "Google Chrome" to reload allTabs
如果有Chromewindows打开不[,@wch1zpink提交的答案将不起作用 包含至少一个带有 mypage.com
URL 的标签。不幸的是,您需要遍历 windows:
tell application "Google Chrome" to repeat with W in windows
reload (every tab in W whose URL contains "mypage.com")
end repeat