Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'More uses for the open command' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
More uses for the open command
Authored by: _merlin on Jun 09, '01 02:04:30AM

You can use the open command to simulate double-clicking any file, folder or bundle in the finder. For example, executing the command 'open /Applications/Mail.app' will launch Apple's Mail application and 'open ~/Documents/letter.rtf' would open a files called letter.rtf in your home directory (assuming such a file exists, of course). You can also specify multiple objects to open. For example 'open ~/Documents ~/Pictures' would open both your Documents and Pictures folders (in separate windows).

You can use this to allow shell scripts (or Perl or Python scripts, for that matter) to open GUI programs, or documents. One use I've come up with is to make a toolbar button in icewn under XWindows that lets me switch back to Aqua. I've set its command to 'open /System/Library/CoreServices/Finder.app' so clicking it will bring the Finder back in front.

Vasantha Crabb



[ Reply to This | # ]