tell application "Google Chrome" activate tell active tab of front window to reload delay 1 tell front window to set index to 1 delay 1 keystroke "r" using {command down, shift down} delay 1 end tell
在这个例子中,我们使用AppleScript激活Google Chrome浏览器,然后刷新当前标签页,并设置标签页的索引为1。在这期间,我们等待1秒钟的时间,以确保页面加载完成。之后,我们使用按下“Command + Shift + R”组合键来刷新整个浏览器窗口。
在编写自己的脚本时,确保在需要时添加适当的等待时间,以避免出现类似的问题。