<!--
{
  "documentType" : "article",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/general-command-execution-errors",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "NSScriptCommand—General Command Execution Errors"
}
-->

# NSScriptCommand—General Command Execution Errors

`NSScriptCommand` uses the following error codes for general command execution problems:

## Topics

### Constants

[`var NSNoScriptError: Int`](/documentation/Foundation/NSNoScriptError)

No error.

[`var NSReceiverEvaluationScriptError: Int`](/documentation/Foundation/NSReceiverEvaluationScriptError)

The object or objects specified by the direct parameter to a command could not be found.

[`var NSKeySpecifierEvaluationScriptError: Int`](/documentation/Foundation/NSKeySpecifierEvaluationScriptError)

The object or objects specified by a key (for commands that support key specifiers) could not be found.

[`var NSArgumentEvaluationScriptError: Int`](/documentation/Foundation/NSArgumentEvaluationScriptError)

The object specified by an argument could not be found.

[`var NSReceiversCantHandleCommandScriptError: Int`](/documentation/Foundation/NSReceiversCantHandleCommandScriptError)

The receivers don’t support the command sent to them.

[`var NSRequiredArgumentsMissingScriptError: Int`](/documentation/Foundation/NSRequiredArgumentsMissingScriptError)

An argument (or more than one argument) is missing.

[`var NSArgumentsWrongScriptError: Int`](/documentation/Foundation/NSArgumentsWrongScriptError)

An argument (or more than one argument) is of the wrong type or is otherwise invalid.

[`var NSUnknownKeyScriptError: Int`](/documentation/Foundation/NSUnknownKeyScriptError)

An unidentified error occurred; indicates an error in the scripting support of your application.

[`var NSInternalScriptError: Int`](/documentation/Foundation/NSInternalScriptError)

An unidentified internal error occurred; indicates an error in the scripting support of your application.

[`var NSOperationNotSupportedForKeyScriptError: Int`](/documentation/Foundation/NSOperationNotSupportedForKeyScriptError)

The implementation of a scripting command signaled an error.

[`var NSCannotCreateScriptCommandError: Int`](/documentation/Foundation/NSCannotCreateScriptCommandError)

Could not create the script command; an invalid or unrecognized Apple event was received.



---

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)