source: trunk/launch/launch/README@ 28

Last change on this file since 28 was 3, checked in by Nicholas Riley, 22 years ago

Initial import.

File size: 7.0 KB
Line 
1launch 1.0a9 [2 April 2002]
2============
3
4A command-line launcher for Mac OS X in the spirit of open(1).
5
6Written by Nicholas Riley <mailto:launchsw@sabi.net>.
7Obtain updates from <http://web.sabi.net/nriley/software/>.
8
9WHAT IS IT?
10-----------
11
12Apple provides a simple command-line launching program called 'open'
13with Mac OS X. It offers few options - launching applications by name
14or by path, launching TextEdit, or opening a number of applications,
15documents, folders, etc. With the exception of special support for
16TextEdit, 'launch' does all this and:
17
18- opens URLs, directly or in your preferred helper application (-l)
19- lets you specify applications by their four-character creator
20 (e.g. 'ToyS') or Java-style bundle ID (e.g. com.apple.scripteditor),
21 both of which allow you to move or rename an application without
22 changing references to it
23- asks applications to print documents, something the OS X Finder
24 no longer permits
25- launches applications in the background
26- launches Carbon applications in Classic
27- displays file information including type, creator, bundle ID,
28 data and resource fork sizes, and dates
29- reports errors intelligibly
30- and much more!
31
32'launch' is useful by itself, but is even better when used in scripts.
33Assign a shell command to your favorite Mac OS text, graphics or
34resource editor. Go to your favorite Web site with a few keystrokes.
35
36Like 'open', 'launch' provides one half of the round-trip between
37Terminal.app and the Finder. You can drag and drop icons or proxy icons
38into Terminal.app to insert their paths into command lines. To go in the
39other direction, just type 'launch .' (or 'open .') to open a Finder window
40showing the current directory.
41
42INSTALLATION
43------------
44
45The commands below install the 'launch' tool in /usr/local/bin, which
46is in the default path. You should subsequently be able to use
47'launch' by typing its name. If you wish to install it somewhere else,
48modify the install line as appropriate.
49
50% sudo /usr/bin/install -c build/launch /usr/local/bin
51% rehash
52
53Uninstallation:
54
55% sudo rm -f /usr/local/bin/launch
56
57COMPILATION
58-----------
59
60A Project Builder project, 'launch.pbproj', is included. A
61precompiled binary is also provided. 'launch' was developed and
62tested under Mac OS 10.1 and 10.1.1 with the 10.1 Developer Tools, and
63does not require any additional software to build.
64
65USAGE
66-----
67
68Just type 'launch' by itself to receive usage information.
69
70Some examples:
71
72% launch -ni com.apple.iTunes
73/Applications/iTunes.app
74[hint, hint]
75
76% launch -c 'R*ch'
77[BBEdit opens]
78
79% launch -pbc 'R*ch' test.txt
80[BBEdit starts printing test.txt in the background]
81
82% launch -l http://www.apple.com/
83[Your preferred Web browser opens Apple's Web site]
84
85/Applications/Preview.app: Mac OS X application package
86 type: 'APPL' creator: 'prvw'
87 bundle ID: com.apple.Preview
88 kind: Application
89 contents: 2 items
90[...]
91
92FREQUENTLY ASKED QUESTIONS
93--------------------------
94
95Q. How do I discover bundle IDs for applications?
96
97A. The -f option to launch can help. Say you have OmniWeb in the
98/Applications/Internet folder, and want to find out its bundle ID.
99Type 'launch -f', and drop the OmniWeb icon on Terminal:
100
101% launch -f /Applications/Internet/OmniWeb.app
102/Applications/Internet/OmniWeb.app: Mac OS X application package
103 type: 'APPL' creator: 'OWEB'
104 bundle ID: com.omnigroup.OmniWeb
105 kind: Application
106
107Note that bundle IDs are not case-sensitive: com.barebones.BBEdit is
108the same as com.barebones.bbedit.
109
110
111Q. Why can't I use -f with -c to get info on an application with a
112given creator?
113
114A. This feature may be added to a later version (or add it yourself!),
115but there is a workaround. Instead of:
116
117% launch -f -c 'Doug'
118launch: can't get information (-f) on item(s) using an application (-u, -c, -i, -a)
119
120use:
121
122% launch -f "`launch -nc 'Doug'`"
123/Volumes/GrayApps/Utilities/Resorcerer 2.4/Resorcerer: scriptable Mac OS X application [Carbon, prefers native OS X]
124 type: 'APPL' creator: 'Doug'
125 kind: Application
126
127
128Q. Why do bundle IDs not work for non-packaged applications?
129
130A. I think this is a LaunchServices/CFBundle bug. For example, BBEdit
1316.1 for OS X was a packaged application; BBEdit 6.5 is not, however its
132'plst' resource contains a bundle ID. LaunchServices is unable to
133locate BBEdit 6.5 by its bundle ID.
134
135Non-packaged applications usually come from older Mac OS applications,
136so they will have creators, which is a workaround (use -c instead of
137-i).
138
139
140Q. Why doesn't launch support opening items as root?
141
142A. Apple eliminated this capability with the Mac OS X 10.1 Security
143Update. If at some point Apple restores this capability, 'launch'
144will be ready to support it.
145
146
147Q. Why do I get an error -600?
148
149A. A typical occurrence of this would be:
150
151% launch -n .
152launch: can't open items: unable to connect to system service.
153Are you logged in? (-600)
154
155In order to perform certain operations, launch needs to talk to
156various system services owned by the currently logged-on user. If you
157aren't using 'launch' from a terminal currently logged into the Mac OS
158X GUI, certain operations may not work. Try opening Terminal.app,
159creating a new terminal, and trying again.
160
161Another possibility is to create your own interprocess messaging.
162For example, place this script in a file:
163
164#!/bin/sh
165PIPE=/tmp/.launchpipe
166[ -e $PIPE ] || mkfifo $PIPE
167while true; do
168 read opts < $PIPE
169 eval "/path/to/launch $opts" & # change this to launch's path
170done
171
172Then, define a function or alias. For zsh:
173
174rlaunch() { echo $@ > /tmp/.launchpipe }
175
176Or for tcsh:
177
178alias rlaunch 'echo \!* > /tmp/.launchpipe'
179
180Start the shell script above from the console, then you can use
181'rlaunch' in place of 'launch' logged in from anywhere else.
182
183Thanks to robert <robert@allyourbass.org> for this suggestion.
184
185COMMENTS, SUGGESTIONS, BUG REPORTS, ETC.
186----------------------------------------
187
188Please send to the author, Nicholas Riley, at <launchsw@sabi.net>.
189
190VERSION HISTORY
191---------------
192
1931.0a9 - 2 April 2002 - license, comments changes
1941.0a8 - 29 March 2002 - errors with -l (from ICeCoffEE), added rlaunch script
1951.0a7 - 3 March 2002 - print dates, sizes, folder valence, locked status for -f,
196 don't abort on failure to obtain bundle information
1971.0a6 - 30 November 2001 - fixed incorrect messages, broken -u and crash on -nu
1981.0a5 - 28 November 2001 - print kind string for -f, still no new installer
1991.0a4 - 20 November 2001 - [try to] use Installer VISE instead of InstallAnywhere
2001.0a3 - 15 November 2001 - fixed package identification in -f, updated examples
2011.0a2 - 15 November 2001 - -f, removed broken -m
2021.0a1 - 14 November 2001 - renamed from "FindApp", launch by default, -u
2031.0d5 - 7 November 2001 - option -s for launching as root [nonfunctional]
2041.0d4 - 6 November 2001 - URL launching and Internet Config support
2051.0d3 - 4 November 2001 - more robust, support for docs without app
2061.0d2 - 4 November 2001 - options -opsbmhCX, -cin, documents
2071.0d1 - 26 August 2001 - returns path of application identified by creator
Note: See TracBrowser for help on using the repository browser.