---
title: sendAction()
framework: appkit
role: symbol
role_heading: Instance Method
path: appkit/nsmatrix/sendaction()
---

# sendAction()

If the selected cell has both an action and a target, sends its action to its target.

## Declaration

```swift
func sendAction() -> Bool
```

## Return Value

Return Value true if an action was successfully sent to a target. If the selected cell is disabled, this method does nothing and returns false.

## Discussion

Discussion If the cell has an action but no target, its action is sent to the target of the receiver. If the cell doesn’t have an action, or if there is no selected cell, the receiver sends its own action to its target.

## See Also

### Related Documentation

- [action](appkit/nscell/action.md)
- [target](appkit/nscell/target.md)

### Managing and Sending Action Messages

- [sendAction(_:to:forAllCells:)](appkit/nsmatrix/sendaction(_:to:forallcells:).md)
- [doubleAction](appkit/nsmatrix/doubleaction.md)
- [sendDoubleAction()](appkit/nsmatrix/senddoubleaction().md)
