<!--
{
  "availability" : [
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSScriptCommand/init(commandDescription:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSScriptCommand(im)initWithCommandDescription:"
  },
  "title" : "init(commandDescription:)"
}
-->

# init(commandDescription:)

Returns an a script command object initialized from the passed command description.

```
init(commandDescription commandDef: NSScriptCommandDescription)
```

## Parameters

`commandDef`

A command description for the command to be created.

## Return Value

A newly initialized instance of `NSScriptCommand` or a subclass.

## Discussion

To make this command object usable, you must set its receiving objects and arguments (if any) after invoking this method.

## See Also

  [Cocoa Scripting Guide](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ScriptableCocoaApplications/SApps_intro/SAppsIntro.html#//apple_ref/doc/uid/TP40002164)

[`receiversSpecifier`](/documentation/Foundation/NSScriptCommand/receiversSpecifier)

Sets the object specifier to `receiversSpec` that, when evaluated, indicates the receiver or receivers of the command.

[`arguments`](/documentation/Foundation/NSScriptCommand/arguments)

Sets the arguments of the command to `args`.



---

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)