Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to start an application (Google Chrome) with a parameter (--enable-sync), but how can you do this on OS X? I've tried creating a terminal script, but I get the error message, "Google" is a folder... (this is of course correct, because applications are bundles on OS X).

share|improve this question
up vote 1 down vote accepted

It's possible to run a command line operation via AppleScript.

The command looks like this:

do shell script "{command}"

You can use the OSX Script Editor to create this script. There's a pretty good intro here: Script Editor Intro

Once you've made your script, you can "Save as Application" to have OSX create an application bundle for your AS file. Then you can launch your application just like any other program!

share|improve this answer

Right click your application and choose for Show Package Contents.
Now search for the chrome binary somewhere in there. Once you have found it, you can start it from a terminal session with

/Applications/<path inside the app folder to the chrome binary> --enable-sync

share|improve this answer
There's no other way? This way, a terminal session needs to be opened? – doekman Aug 18 '09 at 11:01
I suppose you can put that in a script as well. I don't have any experience with that on Mac though. – fretje Aug 18 '09 at 11:56

They didn't make any change to the Mac Chromium Dev build, just on the Windows Dev Build.

share|improve this answer
That's a very useful comment. – doekman Aug 18 '09 at 11:00

The binary executables for Mac application bundles are located in <path_to_bundle>/Contents/MacOS/. So in order to execute an application with some command-line arguments, you'd do something like this:

/Applications/ <arguments> &
share|improve this answer
To get the path, right click the app and select Show Package Contents, navigate to Contents, MacOS and then right click again on the Google Chrome and select Open With Terminal. Now you can copy and paste the full path out of the terminal window. – user40278 Mar 21 '13 at 15:57

open -a Google\ --args "--allow-file-access-from-files"

open is used to open an application in Mac...

share|improve this answer
Can be used, and only for applications recognized by Launch Services (i.e. most application bundles). – Daniel Beck Mar 25 '11 at 9:03

You could wrap your shell script in an application bundle wrapper using Platypus:

"Platypus is a developer tool for the Mac OS X operating system. It can be used to create native, flawlessly integrated Mac OS X applications from interpreted scripts such as shell scripts or Perl, Ruby and Python programs. This is done by wrapping the script in an application bundle directory structure along with an executable binary that runs the script."

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .