NSCloseCommand Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/Foundation.framework
Availability
Available in OS X v10.0 and later.
Companion guide
Declared in
NSScriptStandardSuiteCommands.h

Overview

An instance of NSCloseCommand closes the specified scriptable object or objects—typically a document or window (and its associated document, if any). The command may optionally specify a location to save in and how to handle modified documents (by automatically saving changes, not saving them, or asking the user).

NSCloseCommand is part of Cocoa’s built-in scripting support. It works automatically to support the close command through key-value coding. Most applications don’t need to subclass NSCloseCommand or call its methods.

Tasks

Accessing Save Options

Instance Methods

saveOptions

Returns a constant indicating how to deal with closing any modified documents.

- (NSSaveOptions)saveOptions
Return Value

A constant indicating how to deal with closing any modified documents. The default value returned is NSSaveOptionsAsk. See “Constants” for a list of possible return values.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSScriptStandardSuiteCommands.h

Constants

NSSaveOptions

The saveOptions method returns one of the following constants to indicate how to deal with saving any modified documents:

typedef enum {
   NSSaveOptionsYes = 0,
   NSSaveOptionsNo,
   NSSaveOptionsAsk
} NSSaveOptions;
Constants
NSSaveOptionsYes

Indicates a modified document should be saved on closing without asking the user.

Available in OS X v10.0 and later.

Declared in NSScriptStandardSuiteCommands.h.

NSSaveOptionsNo

Indicates a modified document should not be saved on closing.

Available in OS X v10.0 and later.

Declared in NSScriptStandardSuiteCommands.h.

NSSaveOptionsAsk

Indicates the user should be asked before saving any modified documents on closing. When no option is specified, this is the default.

Available in OS X v10.0 and later.

Declared in NSScriptStandardSuiteCommands.h.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSScriptStandardSuiteCommands.h