---
title: "createCommandInstance(with:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsscriptcommanddescription/createcommandinstance(with:)"
---

# createCommandInstance(with:)

Creates and returns an instance of the command object described by the receiver in the specified memory zone.

## Declaration

```swift
func createCommandInstance(with zone: NSZone? = nil) -> NSScriptCommand
```

## Parameters

- `zone`: The memory zone from which to allocate the command.

## Return Value

Return Value The command object, instantiated from NSScriptCommand or a subclass.

## See Also

### Creating Commands

- [createCommandInstance()](foundation/nsscriptcommanddescription/createcommandinstance().md)
