AppleScript - "Close tabs to right of current tab" in Safari 7 I have been using the AppleScript below as an Automator service in order to get Safari to close all tabs to the right of the current tab. However I have updated to Mavericks (10.9) and find that this no longer works.

Can anyone advise how this AppleScript should be changed in order to make it work again?

Here's the script:

    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
Your script still worked in my limited testing, but you could also try something like this:

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