OpenLocation.scpt
Sun Oct 14, 2007 · 243 words

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

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:


back · essays · credits ·