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/CocoaDialog blahblah`
That works. But is there a better way? Thx - m.
In article C42BA0B9.3B603%matt@tidbits.com Matt Neuburgmatt@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
On 4/16/08 1:29 PM, in article nemoWed041608032838@news.netfielders.de, "Christoph Koehler" christoph.koehler@gmail.com wrote:
In article C42BA0B9.3B603%matt@tidbits.com Matt Neuburgmatt@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")
Interesting - thanks for that. Unfortunately, this little library doesn't implement "filesave" (which is what I want to use), and its most general bottleneck method, cocoa_dialog, is private. So I guess I'll just stick with what I've got... m.
On 17 Apr 2008, at 19:20, Matt Neuburg wrote:
[...] Interesting - thanks for that. Unfortunately, this little library doesn't implement "filesave" (which is what I want to use), and its most general bottleneck method, cocoa_dialog, is private. So I guess I'll just stick with what I've got... m.
You are more than welcome to add a file requester method to TextMate::UI and submit a patch.
We are deprecating the use of CocoaDialog (and I am not 100% sure TM 2 will ship with it), so it would be good to have a TextMate::UI wrapper for these, so we can switch the implementation to use DIALOG when we add file requester support here.
On 4/21/08 8:26 AM, in article 0935703C-9BD1-4721-9287-D57D3D01EF93@macromates.com, "Allan Odgaard" throw-away-2@macromates.com wrote:
We are deprecating the use of CocoaDialog
Ah - then in that case I'll switch to a different way of doing this (probably AppleScript). m.