---
title: NSCloseCommand
framework: foundation
role: symbol
role_heading: Class
path: foundation/nsclosecommand
---

# NSCloseCommand

A command that closes one or more scriptable objects.

## Declaration

```swift
class NSCloseCommand
```

## Overview

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.

## Topics

### Accessing save options

- [saveOptions](foundation/nsclosecommand/saveoptions.md)

### Constants

- [NSSaveOptions](foundation/nssaveoptions.md)

## Relationships

### Inherits From

- [NSScriptCommand](foundation/nsscriptcommand.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Script Commands

- [NSScriptCommand](foundation/nsscriptcommand.md)
- [NSQuitCommand](foundation/nsquitcommand.md)
- [NSSetCommand](foundation/nssetcommand.md)
- [NSMoveCommand](foundation/nsmovecommand.md)
- [NSCreateCommand](foundation/nscreatecommand.md)
- [NSDeleteCommand](foundation/nsdeletecommand.md)
- [NSExistsCommand](foundation/nsexistscommand.md)
- [NSGetCommand](foundation/nsgetcommand.md)
- [NSCloneCommand](foundation/nsclonecommand.md)
- [NSCountCommand](foundation/nscountcommand.md)
