<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSDocument/saveAs(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSDocument(im)saveDocumentAs:"
  },
  "title" : "saveAs(_:)"
}
-->

# saveAs(_:)

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

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

## Parameters

`sender`

The control sending the message.

## 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

[`-  updateChangeCount:`](/documentation/AppKit/NSDocument/updateChangeCount(_:))

Updates the receiver’s change count according to the given change type.

[`fileType`](/documentation/AppKit/NSDocument/fileType)

The name of the document type, as specified in the app’s information property-list file.

[`fileURL`](/documentation/AppKit/NSDocument/fileURL)

The location of the document’s on-disk representation.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)