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

MPW Command Reference


Close

Built-in

SYNTAX

Close [window1 [window2]… | -a] [-c | -n | -y]

DESCRIPTION

The Close command closes the specified windows or all open windows (-a). If you have not saved your changes to a window, a confirmation dialog box appears asking if you would like to do so before closing. You can use the -c, -n, or -y options to handle the dialog box's question noninteractively. This is especially useful in scripts.

INPUT

None

OUTPUT

None

ALIAS RESOLUTION

A partial pathname or a pathname containing Finder aliases may be substituted for the window name as long as the pathname specifies the name of an open window. Note that using a shell variable to designate a window is usually faster than requiring MPW to resolve a Finder alias.

STATUS

Close can return the following status codes:

0

no errors

1

syntax error

2

any other error, such as "Window not found"

4

close canceled from dialog box

PARAMETERS

window1 [window2]…

Specifies one or more windows to be closed. If you do not specify a window, the target window is closed.

OPTIONS

-a

Closes all open MPW Shell windows except for the Worksheet window, which cannot be closed. Note that you cannot specify this option in conjunction with the window1 [window2]… parameter.

-c

Prevents the display of any confirmation dialog boxes by automatically responding Cancel. Specifying this option causes any modified windows to be left open.

-n

Prevents the display of any confirmation dialog boxes by automatically responding No. Specifying this option causes any modified windows to be closed without saving changes.

-y

Prevents the display of any confirmation dialog boxes by automatically responding Yes. Specifying this option causes any modified windows to be saved before closing.

EXAMPLES

By omitting the window1 [window2]… parameter, the following command closes the target window and prompts you with a confirmation dialog box if needed:

Close

The -y option in the following example allows you to avoid any dialog boxes by automatically saving all open windows before closing:

Close -a -y

The following command line does the opposite of the one above, closing windows Test.a and Test.r without saving any of the changes:

Close Test.a Test.r -n

 
 


Last Updated July 2000