<!--
{
  "availability" : [
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSScriptCommandDescription/createCommandInstance(with:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSScriptCommandDescription(im)createCommandInstanceWithZone:"
  },
  "title" : "createCommandInstance(with:)"
}
-->

# createCommandInstance(with:)

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

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

## Parameters

`zone`

The memory zone from which to allocate the command.

## Return Value

The command object, instantiated from [`NSScriptCommand`](/documentation/Foundation/NSScriptCommand) or a subclass.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)