Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 Chrome.app" is a folder... (this is of course correct, because applications are bundles on OS X).

share|improve this question
add comment

6 Answers 6

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
add comment

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/Chrome.app/<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
add comment

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

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

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/Chromium.app/Contents/MacOS/Chromium <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
add comment

open -a Google\ Chrome.app --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
add comment

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

http://sveinbjorn.org/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
add comment

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.