Mac OSX equivalent of zenity

bashdialogscriptui

I'm porting some simple X windows/bash scripts to Mac OSX, but I cannot find a build of Zenity (a Gnome app for basic GUI dialogs) for OSX. Is there some other command line driven dialog utility I can use? Basic operations:
notification dialog

  • List item
  • (i.e. basic title, text, icon, OK button)
  • error notification
  • yes/no or ok/cancel prompts
  • select 1 or n items from a list
  • input text string

I don't (yet) know AppleScript (but it seems pretty verbose for the file maintenance tasks I'm interested in).

Best Answer

Check out cocoaDialog:

cocoaDialog is an OS X application that allows the use of common GUI controls such as file selectors, text input, progress bars, yes/no confirmations and more with a command-line application. It requires no knowledge of Cocoa, and is ideal for use in shell and Perl scripts (or Ruby, or Python, or... etc).

It's a pretty simple concept — pass arguments to the executable to create a dialog, and it returns a result string. There are some good examples as well as documentation.