Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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).

share|improve this question
    
Cocoadialog does not have support for --username and --password like zenity does. Just a note! –  sindhus Oct 13 at 20:27

2 Answers 2

up vote 7 down vote accepted

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.

share|improve this answer
    
thanks- that's just what I need. –  djb Dec 9 '12 at 3:29
    
+1; cocoaDialog is Zenity-like, but (as of April 2014) there's a caveat: the latest stable version is from 2006, the latest beta (rough around the edges) from May 2012. –  mklement0 Apr 14 at 17:10

Try also Pashua.

Pashua is a tool for creating native Aqua dialog windows from programming languages that have none or only limi­ted support for graphic user inter­faces on Mac OS X. Currently, it supports Apple­Script, Perl, PHP, Python, Groovy, Rexx, Ruby, shell scripts and Tcl—and if your favourite language is not included in this list: writing the glue code for communicating with Pashua is pretty simple.

share|improve this answer
    
+1; Pashua is powerful, but the API style is different from Zenity's in that instead of separate command-line arguments (multi-line) configuration strings describing the desired GUI must be passed. Probably takes longer to get started. –  mklement0 Apr 14 at 17:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.