views:

250

answers:

2

Hello,

I am wondering if there is a source of information on how to develop a GUI frontend application for a commandline one in Mac OS X in, but not necessarily, Xcode?

Specifically, I would love a GUI frontend that lets me specify arguments to pass to the commandline program.

Thank you very much.

+2  A: 

Check out:

Nicholas Riley
+3  A: 

You have several options. One of the most commonly used programs to create GUI "front ends" to a script is Platypus. However, this does not allow the user to pass arguments like you want. The other option is creating a Cocoa application and using the NSTask class to run your script with arguments that the user specifies in an NSTextField or NSTokenField. In your case, I think creating a full Cocoa application written in Objective-C is overkill.

The most simple way to get what you want and still have it easy is to create a script written in AppleScript. This is a bare bones script that would do the trick:

display dialog "Enter arguments:" default answer "" buttons {"Cancel", "Run"} default button 2
set scriptArguments to text returned of result
do shell script "/path/to/script " & scriptArguments
macatomy
You can use CocoaDialog[1] with Platypus to accept user input.Also, Pashua[2] lets you create more complex UIs.[1] http://cocoadialog.sourceforge.net/[2] http://www.bluem.net/en/mac/pashua/
Nate
Never saw Pashua before, good find!
macatomy