[TxMt] Re: Freeze Issue when Piping

Dave Grijalva grijalva at gmail.com
Sat Jan 20 01:24:52 UTC 2007


ok.  here's the updated version (sorry if nobody cares)

res=$(CocoaDialog inputbox --title "Open URL" \
    --text "$TM_SELECTED_TEXT" \
    --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: selection or nothing
output: Create New Document


On 1/19/07, Dave Grijalva <grijalva at gmail.com> wrote:
>
> 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 at 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
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20070119/5141d407/attachment.html>


More information about the textmate mailing list