New Dialog System for Commands
Included with the latest build of TextMate (r1305) is a new system for presenting dialogs. The new system allows you to create a custom interface in Interface Builder and then ask TextMate to present it as was it native. This is without writing any code at all.
I have recorded a screencast which introduces the system and shows basic usage.
The screencast is part one of what I plan to be a four or five part series with the upcoming screencasts covering the following topics:
- Using buttons in the dialog (for actions)
- Handling selections in lists and outlines
- Showing progress visually
- Putting it all together
Update (2007-03-15): After this screencast was recorded, a change was made: the tm_dialog
binary has been moved from Support/bin
to be within the Dialog.tmPlugIn
package. That way, the version of the shell command should always match that of the installed plug-in (i.e. if you install a newer version of the plug-in). To get the exact path of the tm_dialog
shell command, in TextMate type: echo "$DIALOG"
and press ⌃R (to execute that line). In your scripts, you should always access tm_dialog
as just "$DIALOG"
(that would be ENV['DIALOG']
for Ruby).
Another common troubleshooting item is running: "$DIALOG" «nib»
and then not see a window. If you do not specify -p/--parameters
then tm_dialog
will read parameters from the standard input. So either press ⌃D to “close” stdin, or give -p '{}'
as argument, and things should work as expected.