Search This Blog

Friday, December 21, 2007

Tips for starting MacOSX apps

  1. If you want to start a MacOSX applications from a terminal (or a shell script) you have to use the open command, i.e.: open /Application/Firefox.app (based on xahlee.org)
  2. If you need to write a wrapper starting a binary file (which is inside of a MacOSX app) with some options you can use following construction: HERE=`dirname $0`; $HERE/name.x -options The same construction is useful if you need to set some environment variables.
  3. Sometimes is it necessary to have a location of an app, but apps can be place in a very strange places. MacOSX binaries are located third level deep inside of an app, so the following command save location of an app in the TOPDIR variable: TOPDIR=`cd $HERE/../../../; pwd`

No comments: