我正在尝试重新加载某个页面的Chrome的所有标签页(可能会打开许多窗口)。这就是我所做的:
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.
我该怎么做?
答案 0 :(得分:0)
这适用于我使用最新版本的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
答案 1 :(得分:0)
如果打开了不至少包含一个带有mypage.com
标签的 Chrome 窗口,则@ wch1zpink提交的答案将不起作用网址。不幸的是,您需要遍历窗口:
tell application "Google Chrome" to repeat with W in windows
reload (every tab in W whose URL contains "mypage.com")
end repeat