0

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 .

2
  • Why do you need it to be an app file? Commented Sep 15, 2010 at 9:07
  • I've created an OSX app in Titanium... as far as i can figure out the Titanium api can only launch OSX apps & not scripts etc. I need to take the arg (its a file path) from Titanium, push it into another app that can launch the file using the associated application. I'm sure there must be a better way but i haven't a clue what it could be. Commented Sep 15, 2010 at 10:14

3 Answers 3

2

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

Sign up to request clarification or add additional context in comments.

Comments

0

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

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

1 Comment

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?
0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.