[TxMt] tm_dialog_read Example.

Luke Daley ld at ldaley.com
Wed Mar 5 22:36:32 UTC 2008


Hi all,

I posted some noise a few days ago about replacing the system read()  
function with an implementation that worked with tm_dialog for the  
purpose of allowing user's to enter input into scripts/processes  
running inside of TextMate (where normally you would enter it on the  
command line).

I have an example of this working in the Groovy bundle.

http://macromates.com/svn/Bundles/trunk/Bundles/Groovy.tmbundle/ 
Support/bin/groovymate.rb

In particular ...

TextMate::DialogRead.init :title => 'GroovyMate', :prompt => "The  
script is requesting some input:"

What this does is set some environment variables up for the process  
that is about to launch (in this case `groovy $TM_FILENAME`). Now  
whenever the running Groovy script reads from STDIN, and there is no  
data currently there, a dialog is presented allowing input to be given.

This is not quite production ready, but if you want to use this kind  
of thing in your bundle I would appreciate you giving it a try so I  
can find issues faster. Contact me if you want to try it out.

Just to be clear, this is not tied to Groovy in any way. It's just  
what I chose for the example.

LD.



More information about the textmate mailing list