---
title: "appleEventCodeForArgument(withName:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsscriptcommanddescription/appleeventcodeforargument(withname:)"
---

# appleEventCodeForArgument(withName:)

Returns the Apple event code for the specified command argument of the receiver.

## Declaration

```swift
func appleEventCodeForArgument(withName argumentName: String) -> FourCharCode
```

## Parameters

- `argumentName`: The argument name (used as a key) for which to obtain the corresponding Apple event code.

## Return Value

Return Value The code for the specified argument.

## See Also

### Getting Command Argument Information

- [argumentNames](foundation/nsscriptcommanddescription/argumentnames.md)
- [isOptionalArgument(withName:)](foundation/nsscriptcommanddescription/isoptionalargument(withname:).md)
- [typeForArgument(withName:)](foundation/nsscriptcommanddescription/typeforargument(withname:).md)
