---
title: NSQuitCommand
framework: foundation
role: symbol
role_heading: Class
path: foundation/nsquitcommand
---

# NSQuitCommand

A command that quits the specified app.

## Declaration

```swift
class NSQuitCommand
```

## Overview

Overview The quit command may optionally specify how to handle modified documents (automatically save changes, don’t save them, or ask the user). For details, see the description for the quit command in “Apple Events Sent By the Mac OS” in How Cocoa Applications Handle Apple Events in Cocoa Scripting Guide. NSQuitCommand is part of Cocoa’s built-in scripting support. Most applications don’t need to subclass NSQuitCommand or call its methods.

## Topics

### Accessing options

- [saveOptions](foundation/nsquitcommand/saveoptions.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)
- [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)
- [NSCloseCommand](foundation/nsclosecommand.md)
