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

# copy(_:)

This action method copies the selected text onto the general pasteboard, in as many formats as the receiver supports.

```
func copy(_ sender: Any?)
```

## Discussion

A plain text object uses `NSStringPboardType` for plain text, and a rich text object also uses `NSRTFPboardType`.

---

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)