2

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

6 Answers 6

1

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!

2

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

2
  • There's no other way? This way, a terminal session needs to be opened?
    – doekman
    Aug 18, 2009 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, 2009 at 11:56
1

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

1
  • 1
    That's a very useful comment.
    – doekman
    Aug 18, 2009 at 11:00
1

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> &
1
  • 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, 2013 at 15:57
1

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

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

1
  • Can be used, and only for applications recognized by Launch Services (i.e. most application bundles).
    – Daniel Beck
    Mar 25, 2011 at 9:03
0

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

You must log in to answer this question.

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