Ollama + Apple Shortcuts + Voice Control (Hey Mac! ๐Ÿš€)

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:

  1. Use your voice to trigger a shortcut
  2. Send the task to Ollama
  3. Return just the AppleScript
  4. Run it automatically!

Boom. Magic. ๐Ÿ”ฎโœจ




๐Ÿ› ๏ธ Step-by-Step Guide



1๏ธโƒฃ Install Ollama & Run a Model Locally

Go to ollama.com and install it.

Then, open Terminal and run:

ollama run llama3
Enter fullscreen mode

Exit fullscreen mode

(Or any model you like โ€” Mistral, Llama 2, etc.)

Itโ€™ll start a local API at:

๐Ÿ“ http://localhost:11434/api/generate



2๏ธโƒฃ 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!



3๏ธโƒฃ Connect Voice Control with Custom Command

Hereโ€™s the cherry on top ๐Ÿ’

  1. Go to System Settings > Accessibility > Voice Control
  2. Turn it ON
  3. Click Commandsโ€ฆ
  4. Click โž• to create a new command:
    • When I say: Hey Mac
    • While using: Any app
    • Perform: Run Shortcut โ†’ Select your shortcut (e.g., โ€œAutoLamaโ€)

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
Enter fullscreen mode

Exit fullscreen mode

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! ๐Ÿ’ฌ๐Ÿ‘‡



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *