<!--
{
  "availability" : [
    "macCatalyst: -",
    "macOS: 10.0.0 - 10.6.0"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTextInput/hasMarkedText",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSTextInput(im)hasMarkedText"
  },
  "title" : "hasMarkedText"
}
-->

# hasMarkedText

Returns a Boolean value indicating whether or not the receiver has marked text.

```
- (BOOL) hasMarkedText;
```

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the receiver has marked text, <doc://com.apple.documentation/documentation/Swift/false> if it doesn’t.

## Discussion

Unlike other methods in this protocol, this one is not called by an input server. The text view itself may call this method to determine whether there currently is marked text. `NSTextView`, for example, disables the Edit > Copy menu item when this method returns <doc://com.apple.documentation/documentation/Swift/true>.

---

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)