April 13, 2017

Keyboard Shortcut to Focus Last Tab in Safari

In Safari, contrary to every other browser out there, ⌘9 switches to the 9th tab and not the last one. This can easiy be solved with an Alfred workflow.

The workflow triggers only in Safari on ⌘9 (or any keyboard shortcut you configure). It runs an AppleScript to figure out the tab count and goes to the last tab:

on alfred_script(q)
    tell application "Safari"
        tell front window
            set current tab to tab (count tabs) -- focus the last tab
        end tell
    end tell
end alfred_script

You can download the finished workflow here:

Safari - Focus Last Tab.alfredworkflow (1.0.0)


Previous post
All Erlang Modules in the Code Path Here’s a little thing of beauty to get all Erlang modules in your code path, should you ever need it: