Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I am looking for an easy way to start different GUI OS X applications from the command line and with different parameters.

If possible I would like to add them to the system PATH in order to call them easier.

Note: I tried open -a "Google Chrome" --args --disable-plugins and it started Chrome but without disabling the plugins.

share|improve this question
    
possible duplicate of Concisely starting Mac OS apps from the command line –  user588 Mar 15 '11 at 15:23
    
I'd also like to know how to open an application from command line with sudo priviledge –  AbiusX Mar 16 '11 at 1:32
    
I added a bug on Chromium code.google.com/p/chromium/issues/detail?id=76342 –  sorin Mar 16 '11 at 9:32

2 Answers 2

Normally you can find the actual executable in the Contents/MacOS folder of the Application bundle. For Chrome try it like so:

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-plugins
share|improve this answer
    
Have you tried it? For me it starts Chrome with the plugins enabled. –  sorin Mar 15 '11 at 10:37
    
@sorin-sbarnea Given your problem here and in the question I suspect Chrome has a problem here. I have used Chrome with some arguments in both ways –  Mark Mar 15 '11 at 11:09
    
this does not work in the same manner as openning the application. –  AbiusX Mar 16 '11 at 1:31

Generally, you do something like this:

exec "/Applications/MyApp.app/Contents/MacOS/MyAppExecutableFile" [arguments]

Running the exec commmand is important, it will end the terminal session and load the command you want. This way you won't kill your program by quitting Terminal or closing the window.

Be sure to also note what the standard flags are set when you double-click the application in the Finder (I've seen about 4 or 5 standard ones) and pass them too for consistent behavior.

As for what you want to do, check the documentation for the application in question.

I don't know if that is the right flag for Chrome, so I can't comment there.

share|improve this answer

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.