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

# saveAs(_:)

The action method invoked in the receiver as first responder when the user chooses the Save As menu command.

## Declaration

```swift
@IBAction func saveAs(_ sender: Any?)
```

## Parameters

- `sender`: The control sending the message.

## Discussion

Discussion The default implementation runs the modal Save panel to get the file location under which to save the document. It writes the document to this file, sets the document’s file location and document type (if a native type), and clears the document’s edited status.

## See Also

### Related Documentation

- [updateChangeCount(_:)](appkit/nsdocument/updatechangecount(_:).md)
- [fileType](appkit/nsdocument/filetype.md)
- [fileURL](appkit/nsdocument/fileurl.md)

### Handling User Actions

- [printDocument(_:)](appkit/nsdocument/printdocument(_:).md)
- [runPageLayout(_:)](appkit/nsdocument/runpagelayout(_:).md)
- [revertToSaved(_:)](appkit/nsdocument/reverttosaved(_:).md)
- [save(_:)](appkit/nsdocument/save(_:).md)
- [saveTo(_:)](appkit/nsdocument/saveto(_:).md)
- [save(withDelegate:didSave:contextInfo:)](appkit/nsdocument/save(withdelegate:didsave:contextinfo:).md)
