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

# isOptionalArgument(withName:)

Returns a Boolean value that indicates whether the command argument identified by the specified argument key is an optional argument.

## Declaration

```swift
func isOptionalArgument(withName argumentName: String) -> Bool
```

## Parameters

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

## Return Value

Return Value true if the specified argument exists and is optional; otherwise, false.

## See Also

### Getting Command Argument Information

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