« httpd.conf goodies | Main | e-iron chef winner »

Using Applescript to connect Quicksilver to STDIN

If you use Quicksilver regularly (I can't operate my computer without it), then you know that you can type "." to get a freeform textbox. Quicksilver ships with a couple useful actions you can perform on that text (including the ever-useful "Append to File..."). But perhaps the most useful thing I've found I can do with that text is pipe it to STDIN of any shell command. Compose the following in Script Editor:

using terms from application "Quicksilver"
	on process text theText
		do shell script 
         "echo " & quoted form of theText & " | mycommand"
	end process text
end using terms from

Replace "mycommand" with the custom perl script of your choosing, and store this script in "~/Library/Application Support/Quicksilver/Actions" You'll probably have to create the Actions directory. Restart Quicksilver. Now, use "." to open the text input field, type some text, and select your script from the Actions pane.

Voila!

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)