The Unix command open -a application_name is a very helpful command, since it automatically searches the default locations for GUI apps and ignores case. For example:
open -a mail
open -a "script editor"
However, it's somewhat of a pain to type the -a and to do the correct quoting every time you want to launch an app without digging through the GUI. Furthermore, I sometimes find it hard to remember which app names have a space (such as Script Editor and Image Capture) and which don't (such as TextEdit and FileMerge). To streamline the behavior of open for the sake of launching applications, I wrote a little shell script that I called launch:
#!/bin/sh
if [ $# -eq 0 ]
then
echo "usage: ${0##*/} <application>"
exit 1
fi
command="$*"
if open -a "$command" &> /dev/null || \
open -a "${command// /}" &> /dev/null then
exit 0
else
echo Couldn\'t launch application \
\""$command"\" or "${command// /}"
fi
This script will invoke open -a with the script arguments in quotes (no need to quote or escape spaces in app names). If that fails, it will try again with the spaces between the arguments collapsed. For example, to open TextEdit, you can type launch text edit or launch textedit. This way, if you're unsure, you can always assume spaces in the name of the application, and the script will do the right thing for you.
Mac OS X Hints
http://hints.macworld.com/article.php?story=2004032210304035