Opening a .app from the command line

On OS X, you can easily open a .app from the command line by typing: 'open /Applications/TextEdit.app/', where the arg is the location of your file.

This has been a public service announcement, after discovering that neither jilldaw nor sbp knew how to do it! .

The application is typically contained in Foo.app/Contents/MacOS/commandname, but that's not universal: mplayer is sometimes packaged such that the actual binary is in MPlayer.app/Resources/mplayer.app/MacOS/mplayer , and you can't even tab complete the last step! I've never understood why that is, but I guess mplayer is probably non-trivial to package and put a frontend on at the same time.

That is all.

* Posted by crschmidt on #d8uv.org at 2006-11-19 13:19:30 UTC.
Christopher Schmidt, and other various and sundry characters.
All code which runs this thing was stolen from sbp. Based on the original nœts site, circa 2003. Design by d8uv, xover, with help from the works of Eric Meyer. Any other people who were involved are also credited and thanked here, in this very small space: . Thank you.