advertisement

Article:
  Learning the Mac OS X Terminal, Part 2
Subject:   Opening apps from the terminal
Date:   2002-01-23 07:34:38
From:   pmccann
Very nicely written article; it's helpful to be able to point people to a complete, correct version of what up to now exists in scattered threads through various osx forums.


To the point, to the point....


If you want to open Mail from the command line (or any other app from the /Applications directory tree) it probably makes more sense to use:


open -a Mail


instead of having to know the full path to Mail.app (That way if you want to open, say, the console application you can simply enter


open -a console


without having to remember that it's buried in the Utilities subdirectory of /Applications.)


Oh yeah, if the application name contains a space you can either quote the name (single or double quotes) or escape the space in the name with a backslash. Thus, to open Disk Copy, for example, you can use any of:


open -a 'disk copy'
open -a "Disk Copy"
open -a disk\ copy


Note that correct case is *not* required when specifying the name.


Cheers,
Paul (hoping that the backslashes in the above survive the trip through the formatter)