OpenLocation.scpt

October 14, 2007

To rid yourself of Safari’s Address bar once and for all:

  • Set your most important non-search sites in the “Bookmarks Bar” bookmark folder so they’re accessible with Cmd-1…9
  • Hide the Address bar
  • To enter URL’s, use either QuickSilver, or something else. I chose to make a really simple AppleScript that I trigger with Cmd-Shift-K which is tailored exactly to my needs.

Using “open location” from Standard Additions means that this will also launch the proper protocol helper if needed (eg if I say “ftp://someplace"):

set input to text returned of (display dialog "" default answer "web:" with title "Open Location")

set AppleScript's text item delimiters to ":"
set choice to text items of input

if (length of choice < 2) then
    set theUrl to choice
    set cmd to "google"
else
    set cmd to item 1 of choice
    set theUrl to item 2 of choice
end if

if (cmd = "web") then
    set theUrl to "http://" & theUrl
else if (cmd = "mu") then
    set theUrl to "http://www.macupdate.com/" & theUrl
else if (cmd = "google") then
    set theUrl to "http://www.google.com/search?q=" & theUrl
else
    set theUrl to input
end if

open location theUrl
set AppleScript's text item delimiters to "".

None of this would be necessary if Safari’s Open Location command would actually do what the ellipsis at the end of it suggests and open a dialog window for the URI.

Two problems with this:

  • No auto-complete
  • No obvious way to copy URL to clipboard