We’re going to use two tools already built in Mac OS X: Automator and Dictation.
First we need to figure out a wake word for our computer. This is similar to “OK Google”, “Alexa” or “Hey Siri” found on handheld or home automation devices.
In this example, I’ll just use “Okay” as the wake word — but I really suggest against it. You don’t want your computer listening for commands (and perhaps misinterpreting some) every time someone says “OK”.
Open System Preferences and head to Keyboard → Dictation and Enable Dictation as well as the “Use enhanced dictation” option. If it’s the first you use dictation, there might be some waiting time while it downloads the files for offline dictation.
Head to Accessibility in System Preferences and scroll down to Dictation. Enable and choose a dictation keyword phrase.
You’re all set up. Now open Automator.app and Create New Project. Select “Dictation Command” as the project type.
Type in the voice command you’d like to program and enable it. There’s a plethora of actions you can easily program from here, but you can also run terminal commands to change system settings (read on for examples).
In my example, I programmed “That’s enough now” to start the screensaver. I’ve already configured my computer to require a password immediately after sleep or screensaver under Security & Privacy settings.
But you can create any kind of voice commands. To turn on or off your WiFi, use the “Run Shell Script” action with:
networksetup -setairportpower airport off
Or perhaps you want to use Siri hands-free, without pressing any keys.
And if you want your computer to talk without emotional display and adopt a placid demeanour, then just use the built-in voice synth using:
say "These violent delights have violent endings."
That’s enough, for now.