Switching Safari Tabs With Custom Shortcuts

Roberto Carvajal

May 28, 2009


So I dumped Minefield / Firefox a while a go to give a try to Safari 4 beta and I really love it, I love the speed and how perfectly integrates into OS X and with the brand new Web Inspector my life is complete, or is it?. Turns out one major flaw in Safari for me is the lack of fast switching into different tabs, Safari has the nice shortcuts ⌘1 to ⌘9 bound to the bookmarks in your bookmark bar instead of the tabs, like Firefox does. So after researching a bit I found a way to do it using QuickSilver + AppleScript but using QuickSilver was kinda of an overkill for me for such a simple task and also it started to crash and I could never recover. Instead a good friend of mine told me about Spark, it’s a light and free shortcut manager that let’s you define custom shortcuts per application and execute scripts / commands, that’s just exactly what you need.

The setup is simple, click “All Applications’s HotKeys” it will show a drawer, click the + button there, add Safari.

In there, hit ⌘1 to add a new AppleScript instruction, name it “Tab1″ and on the source write this:

  tell front window of application "Safari" to set current tab to tab 1

Click the shortcut button and setup your shortcut, I suggest of course for the first tab ⌘1

Hit save, and there you go, repeat that 8 more times changing the tab name, the shortcut and the last number on the AppleScript which refers to the tab name.

Also, as a goodie, I added the LastTab shortcut bound to ⌘0

  tell front window of application "Safari" to set current tab to last tab

After you are done, go back to to Safari and test your brand new custom shortcuts to switch tabs.

Yes, now go ahead and tell your friends!.

Update: I figured out how to do the ⌘K shortcut for the Google Search box in this post: Safari 4 Google Search Shortcut

mark —  July 2, 2009 11:20 am

awesomeeeee, thanks!!!! i just switched over from Firefox to Safari, because FireFox was getting sooo slow

do you also know how to create a short cut for command-K that brings the cursor to the search bar?

Roberto —  July 2, 2009 12:02 pm

Well, I did a quick search on google and found this:

http://5thirtyone.com/archives/506

It doesn’t work on my Safari because I am using the localized version (spanish), but it should work for the stock english version of Safari!

r.

Safari 4 Google Search Shortcut « Roberto Carvajal —  October 1, 2009 10:27 am

[...] By default Safari 4 has a very annoying shortcut to use the Google Search box and I am already used to the ⌘K shortcut that Firefox has, to fix this we are going to use the same program I showed at my previous tip: Switching Safari Tabs With Custom Shortcuts. [...]

WooThemes