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

# setParam(_:forKeyword:)

Adds a descriptor to the receiver as an Apple event parameter identified by the specified keyword.

## Declaration

```swift
func setParam(_ descriptor: NSAppleEventDescriptor, forKeyword keyword: AEKeyword)
```

## Parameters

- `descriptor`: The parameter descriptor to add to the receiver.
- `keyword`: A keyword (a four-character code) that identifies the parameter descriptor to add. If a descriptor with that keyword already exists in the receiver, it is replaced.

## Discussion

Discussion The receiver must be an Apple event or Apple event record, both of which can contain parameters.

## See Also

### Working With Apple Event Descriptors

- [attributeDescriptor(forKeyword:)](foundation/nsappleeventdescriptor/attributedescriptor(forkeyword:).md)
- [eventClass](foundation/nsappleeventdescriptor/eventclass.md)
- [eventID](foundation/nsappleeventdescriptor/eventid.md)
- [paramDescriptor(forKeyword:)](foundation/nsappleeventdescriptor/paramdescriptor(forkeyword:).md)
- [removeParamDescriptor(withKeyword:)](foundation/nsappleeventdescriptor/removeparamdescriptor(withkeyword:).md)
- [returnID](foundation/nsappleeventdescriptor/returnid.md)
- [setAttribute(_:forKeyword:)](foundation/nsappleeventdescriptor/setattribute(_:forkeyword:).md)
- [transactionID](foundation/nsappleeventdescriptor/transactionid.md)
