Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Launching a .app folder from the terminal



Geoff Levner wrote:

"open yourapp.app" should do it, as I recall.

Kai-Mikael Jaa-Aro wrote:

Won't

open -a foo.app

work?

Both of these will open the application. The command can also be used with a document file, as in:


    open -a foo.app /path/to/some/document/xxx.foo

to open document /path/to/some/document/xxx.foo with foo.app. If foo.app isn't in one of the usual places (e.g. /Applications) it may be necessary to use a full pathname. You can also use open with just a document path to open the document with the default application (e.g. open xxx.foo). There are other forms too (e.g. -b BUNDLE-ID), but they aren't universal to all OS X versions (the two referenced in the original posts go all the way back to 10.1.x, but -b was new with 10.4 IIRC).

See "man open" for the full details.

Also, be sure to follow the usual safety precautions when using Runtime.exec (use the String[] form, drain the output streams, etc.). The issue has been beaten to death in the past, I think there are code examples in the archives of how to do it right.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden


This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.