ok.  I was being stupid here.  There's no reason for me to pipe this back into tm.  Just choosing "Create new document" from the output pulldown does the same thing.

For those that are interested, here's the final code:

res=$(CocoaDialog inputbox --title "Open URL" \
    --informative-text "URL:" \
    --button1 "Okay" --button2 "Cancel")

[[ $(head -n1 <<<"$res") == "2" ]] && exit_discard

res=$(tail -n1 <<<"$res")
/usr/bin/env ruby -e "require 'net/http';require 'uri';Net::HTTP.get_print URI.parse('$res')"

---------------
save: nothing
input: none
output: Create New Document

activtaion: cmd+shift+o

for my next trick, I'm going to try to allow the selected text to be the default param for the input box.

-dave

On 1/19/07, Dave Grijalva <grijalva@gmail.com> wrote:
I'm working on an action to allow me to quickly open a url in textmate:

res=$(CocoaDialog inputbox --title "Open URL" \
    --informative-text "URL:" \
    --button1 "Okay" --button2 "Cancel")

[[ $(head -n1 <<<"$res") == "2" ]] && exit_discard

res=$(tail -n1 <<<"$res")
/usr/bin/env ruby -e "require 'net/http';require 'uri';Net:: HTTP.get_print URI.parse('$res')" | mate

Basically, I'm using ruby to grab the page and output the content to stdout, then piping that to TextMate.  If i call this from the command line, it works perfectly.  problem is, if i call this as an command from within textmate, it completely freezed the app.  The page does open, but tm becomes completely unresponsive and I have to quit and restart.  any ideas what I'm doing wrong?

thanks
-dave