<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTextViewDelegate/textView(_:doubleClickedOn:in:at:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSTextViewDelegate(im)textView:doubleClickedOnCell:inRect:atIndex:"
  },
  "title" : "textView(_:doubleClickedOn:in:at:)"
}
-->

# textView(_:doubleClickedOn:in:at:)

Sent when the user double-clicks a cell.

```
@MainActor optional func textView(_ textView: NSTextView, doubleClickedOn cell: any NSTextAttachmentCellProtocol, in cellFrame: NSRect, at charIndex: Int)
```

## Parameters

`textView`

The text view sending the message.

`cell`

The cell double-clicked by the user.

`cellFrame`

The frame of the double-clicked cell.

`charIndex`

The character index of the double-clicked cell.

## Discussion

The delegate can use this message as its cue to perform an action, such as opening the file represented by the attachment. `aTextView` is the first text view in a series shared by a layout manager, not necessarily the one that draws `cell`.

---

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)