applescript - 使用 AppleScript 重新加载某个页面的所有 chrome 选项卡
问题描述
我正在尝试重新加载某个页面的所有 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.
我该怎么做呢?
解决方案
如果打开的任何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
推荐阅读
- python - 有没有办法改变lcdNumber?
- android - 狩猎诡异的offline.html
- gradle - 如何修复未解决的参考:Gson?
- javascript - 当值超过数字时在浏览器中心弹出警告
- javascript - 如何修复 toDataURL 返回空字符串
- authentication - 用户在忘记密码过程开始时登录,让我进入?
- php - 使用 Symfony DomCrawler 在 html 元素属性(data-react-props)中提取数据
- python - 在 python 中,如何进行这样的部分函数调用:partial(adder, 2)(4)?
- c# - 使用自定义结转对两个双打列表进行精确除法创建数学时遇到问题
- delphi - Delphi - 编译的EXE图标错误,无法更改