Next Page > Hide TOC

NSCloseCommand Class Reference

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

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
Related Sample Code
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 Mac OS X v10.0 and later.

Declared in NSScriptStandardSuiteCommands.h.

NSSaveOptionsNo

Indicates a modified document should not be saved on closing.

Available in Mac 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 Mac OS X v10.0 and later.

Declared in NSScriptStandardSuiteCommands.h.

Availability
Declared In
NSScriptStandardSuiteCommands.h

Next Page > Hide TOC


© 2006 Apple Computer, Inc. All Rights Reserved. (Last updated: 2006-06-28)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.