Tools: MPW
Advanced Search
Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

MPW Command Reference




Commando [commandName] [-modify] [-navsvc | -stdfile]


The Commando tool lets you create and execute a command line for any MPW command, tool, or script by using specialized Macintosh dialog boxes called Commando dialog boxes instead of the ordinary command-line method. Each Commando dialog box contains controls in the form of text fields, buttons, checkboxes, and pop-up menus that represent elements in the command's syntax. When you use a Commando dialog box and its controls to specify your options and choices, MPW efficiently composes a syntactically correct command line for that command.

When running on a Power Macintosh machine, the Commando tool can use either Navigation Services or StandardFile to draw the file/folder selection dialogs. Which one is used depends upon the availability of Navigation Services and the setting of the {UseStandardFile} Shell environment variable, if the variable is exported. When running on a 680x0 machine, the Commando tool will always use StandardFile to draw the file/folder selection dialogs. •

When the Commando dialog box first appears, the Command Line field contains only the name of the command (for example, StreamEdit). By selecting other dialog box controls, such as buttons, checkboxes, and pop-up menus, you can add options, parameters, and other elements of the command's syntax to the command line. As you click different controls, the Help field changes from a description of the command to a description of that syntax element. Commands with many options and parameters often employ one or more nested dialog boxes.

To invoke a commando dialog box, use one of the following methods:

• Commando commandName

commandName(Create the ellipsis by using Option-semicolon)

commandName <Option-Enter>

If you invoke Commando by using the first method, such as

Commando StreamEdit

Commando writes to standard output the command line you subsequently create when you click the "do it" button to close the dialog box. The "do it" button is located at the lower right of the dialog box and is labeled with the command's name.

If you invoke Commando using either of the other methods, such as


StreamEdit <Option-Enter>

MPW executes the command line when you click the "do it" button to close the dialog box.

You can quit Commando, without writing or executing the command line, by clicking Cancel.

The Commando dialog box for the tool StreamEdit is reproduced below. Although the Commando dialog boxes have individual differences for each command, they all have the same basic control structure shown here.

Each commando dialog box displays the command's version number below its "do it" button. (Here it is version 3.3.) To do this, Commando uses either an 'MPST' string resource or one of the 'vers' resources. If a version dialog box, which displays the command's version number, is part of the command's resources, Commando looks for an 'MPST' resource. Otherwise, it looks for a 'vers' resource -- first 'vers',1 and then 'vers',2 -- and displays its short version string below the "do it" button. Clicking on this version number causes the long version string to be displayed in the Help field. (For more information on version resources, see Inside Macintosh.) •

Commando dialog boxes are movable. In addition, Commando allows you to change the appearance of a commando dialog box, if you specify the -modify option on the command line or hold down the Command key while the Commando dialog box is opening (and displaying the beach ball cursor). You can resize and move the controls (including text fields, buttons, and menu titles) using the mouse exactly as you would in the Finder, except you must hold down the Option key as you drag controls.

Commando dialog boxes are stored as 'cmdo' resources in each tool or script. For MPW built-in commands, the 'cmdo' resources are part of the MPW Shell application. If a Commando dialog box has been modified when the "do it" button is clicked, you are prompted to replace the existing 'cmdo' resource with the new modified version. If you choose to replace the existing 'cmdo' resource, the original format of the Commando dialog box is lost.




None, unless you invoke a Commando dialog box by typing

Commando commandName

In this case, Commando writes the command line you created to standard output when you click the "do it" button. If you invoke Commando by using one of the other methods discussed in "Description," Commando executes the command line when you click the "do it" button.

You can also achieve various execution behaviors by pressing certain keys while clicking the "do it" button. If you press Option, Commando executes the command line and echoes it to the Worksheet window. If you press Command and Option, Commando echoes the command line to the Worksheet window but does not execute it. If you press only Command, Commando suppresses execution of the command. •


Commando can return the following status codes:


"do it" button selected


Cancel button selected


error while reading the 'cmdo' resource


I/O or program error



Specifies the name of the command for which Commando produces a dialog box.



Enables you to edit Commando dialog boxes.


Forces the use of Navigation Services dialogs (if Navigation Services is available).


Forces the use of StandardFile dialogs.


Executing the following command line displays the Commando dialog box for the CMarker tool.

Commando CMarker


Last Updated July 2000

Get information on Apple products.
Visit the Apple Store online or at retail locations.

Copyright © 2004 Apple Computer, Inc.
All rights reserved. | Terms of use | Privacy Notice