[TxMt] Re: how to call CocoaDialog from Ruby?

Christoph Koehler christoph.koehler at gmail.com
Wed Apr 16 20:29:47 UTC 2008


In article <C42BA0B9.3B603%matt at tidbits.com> Matt
Neuburg<matt at tidbits.com> wrote:
>  In my Ruby script which is called somewhat indirectly, I tried
> saying `CocoaDialog blahblah` but it didn't work; evidently the
> indirectness means that I'm not inheriting some path trickery from
> TM. So I changed it to this:


> `#{ENV['TM_SUPPORT_PATH']}/bin/CocoaDialog.app/Contents/MacOS/CocoaDia
>  logblahblah`

>  That works. But is there a better way? Thx - m.

Here's how I do it:

#! /usr/bin/env ruby
require ENV['TM_SUPPORT_PATH'] + '/lib/ui'
test = TextMate::UI.request_string(:title => "Some title", :prompt =>
"Please type something here")

Hope that helps.

Christoph


-- 

I'm using an evaluation license of nemo since 310 days.
You should really try it!
http://www.malcom-mac.com/nemo





More information about the textmate mailing list