You can use this block of AppleScript to loop through your tabs on a window:
tell application "Safari"
repeat
repeat with i from (count of tabs of window 1) to 1 by -1
set thisTab to tab i of window 1
set current tab of window 1 to thisTab
delay 1
end repeat
end repeat
end tell
This will go through all your tabs and switch every 1 second. Just change the delay to change the time before each tab switches.
I have tried the following key combinations in an attempt to do this, to no effect:
- Command+Return ...+Space
- Option+Return ...+Space
- Control+Return ...+Space
- Command+Shift+\ (The "Show All Tabs" Command on my Macbook)
This leads me to believe that it really is an oversight on Apple's part.
Kludge: Create An Automator Command to Simulate A Mouse Click
I used code that I found at https://discussions.apple.com/thread/3708948 to put together the following AppleScripts:
Attempt 1: Didn't Work
I ran this code in an Applescript wrapped in an Automator Service mapped to "Command+Shift+Option+Control+Space", using the numbers I get from pressing "Command+Control+Shift+4" to get the address for the area (600 pixels horizontal from left, 300 pixels vertical from top), and it would work in normal Safari (pressing the key combination would make the mouse click at that pixel address), but it had no effect when the same key command was run in the "Show All Tabs" mode in Safari!
on run {input, parameters}
tell application "System Events"
tell process "Safari"
click at {600, 300}
end tell
end tell
return input
end run
Attempt #2: Worked, but Not Feasible
I did get a key command working with the following Applescript wrapped in an Automator Service, but it took 5.125 seconds to complete:(
on run {input, parameters}
set x to 600
set y to 150
do shell script "
/usr/bin/python <<END
import sys
import time
from Quartz.CoreGraphics import *
def mouseEvent(type, posx, posy):
theEvent = CGEventCreateMouseEvent(None, type, (posx,posy), kCGMouseButtonLeft)
CGEventPost(kCGHIDEventTap, theEvent)
def mousemove(posx,posy):
mouseEvent(kCGEventMouseMoved, posx,posy);
def mouseclick(posx,posy):
mouseEvent(kCGEventLeftMouseDown, posx,posy);
mouseEvent(kCGEventLeftMouseUp, posx,posy);
ourEvent = CGEventCreate(None);
currentpos=CGEventGetLocation(ourEvent); # Save current mouse position
mouseclick(" & x & "," & y & ");
mousemove(int(currentpos.x),int(currentpos.y)); # Restore mouse position
END"
return input
end run
Best Answer
You can search in Safari's open tabs: Two-finger pinch on the track pad, then start writing any word in the tab you’re looking for.