<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTextView/markedTextAttributes",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSTextView(py)markedTextAttributes"
  },
  "title" : "markedTextAttributes"
}
-->

# markedTextAttributes

The attributes used to draw marked text.

```
var markedTextAttributes: [NSAttributedString.Key : Any]? { get set }
```

## Discussion

Text color, background color, and underline are the only supported attributes for marked text.

## See Also

[`-  markedRange`](/documentation/AppKit/NSTextInput/markedRange)

Returns the range of the marked text.



---

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)