---
title: "handleSave(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsdocument/handlesave(_:)"
---

# handleSave(_:)

Handles the Save AppleScript command by attempting to save the document.

## Declaration

```swift
func handleSave(_ command: NSScriptCommand) -> Any?
```

## Parameters

- `command`: An AppleScript command object.

## Discussion

Discussion Extracts Save command arguments from the command object and uses them to determine the file in which to save the document and the file type.

## See Also

### Handling Script Commands

- [handleClose(_:)](appkit/nsdocument/handleclose(_:).md)
- [handlePrint(_:)](appkit/nsdocument/handleprint(_:).md)
- [objectSpecifier](appkit/nsdocument/objectspecifier.md)
- [lastComponentOfFileName](appkit/nsdocument/lastcomponentoffilename.md)
