AppleScript - Safari 7中的“关闭当前选项卡右侧的选项卡”


1

我一直在使用下面的AppleScript作为Automator服务,以使Safari关闭当前选项卡右侧的所有选项卡。但是我已经更新到Mavericks(10.9)并且发现这不再有效。

任何人都可以建议如何更改AppleScript以使其再次运行?

这是脚本:

    tell application "Safari"
  set indexActive to index of current tab of window 1
    repeat until (get index of last tab of window 1) = indexActive
        close last tab of window 1
    end repeat
end tell

你可以把代码放在问题而不是外部网站
— 马克

Answers:


3

您的脚本仍然在我的有限测试中工作,但您也可以尝试这样的事情:

tell window 1 of application "Safari"
    close (tabs where index > (get index of current tab))
end

奇怪的。重启后,它又开始工作了。并感谢简洁的替代脚本!
— Macrod 2013年
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.