Ollama + Apple Shortcuts + Voice Control (Hey Mac!
)

Hey there, fellow tech explorer! Ever wished your Mac could just listen and do what you ask? Like:
โHey Mac, generate an AppleScript for me!โ
Well guess what? You can make that happen โ without any cloud magic. Itโs all local, private, and totally in your control
Let me walk you through how I created a simple AI agent using:
Ollama (running AI models locally)
Apple Shortcuts (automation awesomeness)
Voice Control (so I can just speak commands)
Custom phrase: โHey Mac!โ
What Weโre Gonna Build
โHey Mac, write an AppleScript to mute the volume.โ
This command will:
- Use your voice to trigger a shortcut
- Send the task to Ollama
- Return just the AppleScript
- Run it automatically!
Boom. Magic.
Step-by-Step Guide
Install Ollama & Run a Model Locally
Go to ollama.com and install it.
Then, open Terminal and run:
ollama run llama3
(Or any model you like โ Mistral, Llama 2, etc.)
Itโll start a local API at:
http://localhost:11434/api/generate
Create the Shortcut in Apple Shortcuts
Hereโs what the shortcut does (you saw this in the screenshot):
Dictate Text โ You speak the task
Sends:
"Return only valid AppleScript code. Do not explain. The task is:
" GET request to:
http://localhost:11434/api/generate
Extracts the pure AppleScript (removes backticks and tags)
Runs it using
osascript
Done!
Connect Voice Control with Custom Command
Hereโs the cherry on top
- Go to System Settings > Accessibility > Voice Control
- Turn it ON
- Click Commandsโฆ
- Click
to create a new command:
-
When I say:
Hey Mac
- While using: Any app
- Perform: Run Shortcut โ Select your shortcut (e.g., โAutoLamaโ)
-
When I say:
Now say:
โHey Macโ
It triggers your shortcut
Example in Action
Letโs say I want to create a new folder on my Desktop. I say:
โHey Mac, create a folder named LlamaMagic on desktop.โ
Your shortcut will:
- Send that to the local LLM
- Receive:
tell application "Finder"
make new folder at desktop with properties {name:"LlamaMagic"}
end tell
You just spoke an idea and your Mac obeyed like a friendly genie
Bonus Tips
- You can change the prompt to ask for shell scripts, Python, or whatever!
- Add more automation, like asking for confirmation before running
- Use clipboard instead of voice if youโre shy
Final Thoughts
This was super fun to build, and it makes your Mac feel like a personal AI assistant. Everything is local โ no internet, no tracking, no middleman!
All you need is:
- Ollama
- A Shortcut
- Voice Control
- A little creativity
Now go impress your friends and make your Mac say โYour wish is my command.โ
If you liked this guide, share it with your geeky friends and tell them:
โYou donโt need Siri. You need Shortcuts + Ollama!โ
Need help setting it up? Drop your questions below!