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

# typeForArgument(withName:)

Returns the type of the command argument identified by the specified key.

## Declaration

```swift
func typeForArgument(withName argumentName: String) -> String?
```

## Parameters

- `argumentName`: Argument name (used as a key) that identifies the command argument to examine.

## Return Value

Return Value The type of the specified command argument. Returns nil if there is no such argument.

## See Also

### Getting Command Argument Information

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