<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSSpeechRecognizer/commands",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSSpeechRecognizer(py)commands"
  },
  "title" : "commands"
}
-->

# commands

An array of strings defining the commands for which the speech recognizer object should listen.

```
var commands: [String]? { get set }
```

## Discussion

Setting this property when the speech recognizer is already listening means that the current command list is updated and listening continues. The items in the array should be <doc://com.apple.documentation/documentation/Foundation/NSString> objects. The command strings must match the current locale of the recognizer, which is selected in the Dictation pane of Accessibility system preferences.

---

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)