CloseA 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 inparameters recognized by AppleScript and most other applications.
- 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.
RESULTReference to the closed window or a list of references.
EXAMPLESThis statement closes all Finder windows:
tell application "Finder" to close windowsThis statement closes all Finder windows whose name includes the word "messages":
tell application "Finder" close windows whose name contains "messages" endYou 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