使用AppleScript重新加载特定页面的所有chrome选项卡
我正在尝试重新加载某个页面的所有Chrome选项卡(我可以打开许多窗口)。这就是我所做的:使用AppleScript重新加载特定页面的所有chrome选项卡,applescript,Applescript,我正在尝试重新加载某个页面的所有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出现了一个错
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出现了一个错误:无法将窗口id 1的项目1转换为整数类型。
如何做到这一点?我使用最新版本的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
如果任何打开的Chrome窗口不包含至少一个带有
mypage.com
URL的选项卡,则@wch1zpink提交的答案将无效。不幸的是,您需要遍历窗口:
tell application "Google Chrome" to repeat with W in windows
reload (every tab in W whose URL contains "mypage.com")
end repeat
或者告诉应用程序“Google Chrome”重新加载(URL包含“mypage.com”的窗口选项卡)