HereShell

July 5, 2007

Errr, this is about as basic as it gets, but:

tell application "Finder"
	set currDir to quoted form of POSIX path of (target of window 1 as alias)
	set theCommand to text returned of (display dialog "" default answer "ls")
try
	set out to do shell script "cd " & currDir & ";" & theCommand
	if (out is not "") then
		display alert out
	end if
on error e
	display alert e buttons "Bummer"
end try
end tell

Save that to the right place, give it a shortcut and now I can run shell commands into the frontmost Finder window. Really handy for situations like these:

HereShell 1

or, typically:

hereshell 2