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

# duplicate(_:)

Creates a copy of the receiving document in response to the user choosing Duplicate from the File menu.

## Declaration

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

## Parameters

- `sender`: The control sending the action message.

## Discussion

Discussion The default implementation of this method merely invokes [self duplicateDocumentWithDelegate:nil didDuplicateSelector:NULL contextInfo:NULL].

## See Also

### Duplicating the Document

- [duplicate()](appkit/nsdocument/duplicate().md)
- [duplicate(withDelegate:didDuplicate:contextInfo:)](appkit/nsdocument/duplicate(withdelegate:didduplicate:contextinfo:).md)
