views:

49

answers:

3

Hi

As it says ... in OSX can i create an application based off a bash script - that accepts arguments ?

So for example i can run in terminal :

open /path/to/MyBashScriptApp.app myArgument1

This app will run with the argument passed to it?

I know i can rename to .command - but i need it to be an app .

A: 

If you are using OS X 10.6 then you can do:

% open /path/to/App.app --args arg1 arg2 ... 

Check out this related question from superuser

http://superuser.com/questions/180995/passing-command-line-args-to-open-on-mac

dtlussier
Unfortunately I don't have an .app yet - this is what i'm trying to build. Is there a way to shove this into an .app container?
boomshanka
@boomshanka Sorry I thought you already had an app bundle.
dtlussier
A: 

Use Automator, which can be found in your

/Applications/Utilities/Automator.app 

With it you can easily package a bash script into an app, accepting file names. Look for an action called "Run Shell Script".

Yuji
A: 

There's also a command line interface to Automator, automator(1), which has an -i & -D switch for user-specified input.

yabt