---
title: "forKeyword(_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsappleeventdescriptor/forkeyword(_:)"
---

# forKeyword(_:)

Returns the receiver’s descriptor for the specified keyword.

## Declaration

```swift
func forKeyword(_ keyword: AEKeyword) -> NSAppleEventDescriptor?
```

## Parameters

- `keyword`: A keyword (a four-character code) that identifies the descriptor to obtain.

## Return Value

Return Value A descriptor for the specified keyword, or nil if an error occurs.

## See Also

### Working With Record Descriptors

- [keywordForDescriptor(at:)](foundation/nsappleeventdescriptor/keywordfordescriptor(at:).md)
- [remove(withKeyword:)](foundation/nsappleeventdescriptor/remove(withkeyword:).md)
- [setDescriptor(_:forKeyword:)](foundation/nsappleeventdescriptor/setdescriptor(_:forkeyword:).md)
