Safari Tab Shortcuts
Mac OS X — 11 Feb 2009 15:46 — 533 days ago

Here’s an AppleScript implementation of a great idea by Ebi.

It provides numeric keyboard shortcuts to jump to a specific Safari Tab directly. You can press ⌘-⌥-1 to switch to the first tab, ⌘-⌥-2 for the second etc.

Here’s the script code:
set myPath to (path to me) as text
set tabNumber to (word -2 of myPath) as number

tell application "Safari"
	tell window 1
		try
			set current tab to tab tabNumber
		on error
			beep
		end try
	end tell
end tell

I saved this exact same script nine times with the following file names:

Switch to Tab 1.scpt
Switch to Tab 2.scpt
Switch to Tab 3.scpt
...

I put them in my Home > Library > Scripts > Applications > Safari folder and used FastScripts to assign numeric keyboard shortcuts:

Safari Tab Shortcuts - FastScripts Preferences

Pick whatever you like, you can also use Ctrl-1, ⌘-1 etc.


Comments
Posted by ebi on 13 Feb 2009 09:39

Check out http://www.macosxhints.com/article.php?story=20070730145747991

It generates those scripts and also one for the last tab which I select with ⌘0. It uses front window instead of window 1 which is a little bit smarter too :)

Besides of that GREAT WORK I started using Safari again because of this…

Powered By blojsom