Previous Book Contents Book Index Next

Inside Macintosh: AppleScript Finder Guide /
Chapter 3 - Finder Commands / Command Definitions


Close

A Close command is a request to close one or more windows. The Finder version of the Close command behaves like the standard version described in the AppleScript Language Guide, except that the Finder ignores the saving and saving in parameters recognized by AppleScript and most other applications.

SYNTAX
close referenceToObject 
PARAMETERS
referenceToObject
A reference to the object to close or a list of references. The reference can be to either a window or a container to which
a window belongs.
Class: Reference
RESULT
Reference to the closed window or a list of references.

EXAMPLES
This statement closes all Finder windows:

tell application "Finder" to close windows
This statement closes all Finder windows whose name includes the word "messages":

tell application "Finder"
   close windows whose name contains "messages"
end
You can also specify a container to which a window belongs as the parameter of the Close command:

tell application "Finder"
   close startup disk
end tell

Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996