<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: ijayasurya</title>
    <description>The latest articles on DEV Community by ijayasurya (@ijayasurya).</description>
    <link>https://dev.to/ijayasurya</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F686588%2Fc5b04ef7-5948-4d4a-bda6-4ac2e1e0fafe.jpeg</url>
      <title>DEV Community: ijayasurya</title>
      <link>https://dev.to/ijayasurya</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ijayasurya"/>
    <language>en</language>
    <item>
      <title>Ollama + Apple Shortcuts + Voice Control (Hey Mac! 🚀)</title>
      <dc:creator>ijayasurya</dc:creator>
      <pubDate>Tue, 15 Apr 2025 15:48:54 +0000</pubDate>
      <link>https://dev.to/ijayasurya/ollama-apple-shortcuts-voice-control-hey-mac--2glk</link>
      <guid>https://dev.to/ijayasurya/ollama-apple-shortcuts-voice-control-hey-mac--2glk</guid>
      <description>&lt;p&gt;Hey there, fellow tech explorer! 👋 Ever wished your Mac could just &lt;em&gt;listen&lt;/em&gt; and do what you ask? Like:  &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Hey Mac, generate an AppleScript for me!"&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Well guess what? You &lt;em&gt;can&lt;/em&gt; make that happen — &lt;strong&gt;without any cloud magic&lt;/strong&gt;. It's all local, private, and totally in your control 😎&lt;/p&gt;

&lt;p&gt;Let me walk you through how I created a simple AI agent using:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🦙 &lt;strong&gt;Ollama&lt;/strong&gt; (running AI models locally)&lt;/li&gt;
&lt;li&gt;🍏 &lt;strong&gt;Apple Shortcuts&lt;/strong&gt; (automation awesomeness)&lt;/li&gt;
&lt;li&gt;🗣️ &lt;strong&gt;Voice Control&lt;/strong&gt; (so I can just speak commands)&lt;/li&gt;
&lt;li&gt;🎩 Custom phrase: “Hey Mac!”&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🎯 What We’re Gonna Build
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;"Hey Mac, write an AppleScript to mute the volume."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This command will:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Use your &lt;strong&gt;voice&lt;/strong&gt; to trigger a shortcut&lt;/li&gt;
&lt;li&gt;Send the task to &lt;strong&gt;Ollama&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Return just the AppleScript&lt;/li&gt;
&lt;li&gt;Run it automatically!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Boom. Magic. 🔮✨&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ Step-by-Step Guide
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1️⃣ Install Ollama &amp;amp; Run a Model Locally
&lt;/h3&gt;

&lt;p&gt;Go to &lt;a href="https://ollama.com" rel="noopener noreferrer"&gt;ollama.com&lt;/a&gt; and install it.&lt;/p&gt;

&lt;p&gt;Then, open Terminal and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ollama run llama3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(Or any model you like — Mistral, Llama 2, etc.)&lt;/p&gt;

&lt;p&gt;It’ll start a local API at:&lt;br&gt;&lt;br&gt;
📍 &lt;code&gt;http://localhost:11434/api/generate&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2️⃣ Create the Shortcut in Apple Shortcuts
&lt;/h3&gt;

&lt;p&gt;Here’s what the shortcut does (you saw this in the screenshot):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🎙️ &lt;strong&gt;Dictate Text&lt;/strong&gt; – You speak the task&lt;/li&gt;
&lt;li&gt;📝 Sends: &lt;code&gt;"Return only valid AppleScript code. Do not explain. The task is: &amp;lt;your task&amp;gt;"&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;🌐 &lt;strong&gt;GET&lt;/strong&gt; request to: &lt;code&gt;http://localhost:11434/api/generate&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;🪄 Extracts the pure AppleScript (removes backticks and tags)&lt;/li&gt;
&lt;li&gt;🖥️ Runs it using &lt;code&gt;osascript&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;✅ Done!&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3️⃣ Connect Voice Control with Custom Command
&lt;/h3&gt;

&lt;p&gt;Here’s the cherry on top 🍒&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to &lt;strong&gt;System Settings &amp;gt; Accessibility &amp;gt; Voice Control&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Turn it ON&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Commands…&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Click ➕ to create a new command:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;When I say&lt;/strong&gt;: &lt;code&gt;Hey Mac&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;While using&lt;/strong&gt;: Any app&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Perform&lt;/strong&gt;: Run Shortcut → Select your shortcut (e.g., "AutoLama")&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now say:  &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Hey Mac"&lt;/em&gt;&lt;br&gt;&lt;br&gt;
It triggers your shortcut 🎤🤖&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  😍 Example in Action
&lt;/h2&gt;

&lt;p&gt;Let’s say I want to create a new folder on my Desktop. I say:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Hey Mac, create a folder named LlamaMagic on desktop.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Your shortcut will:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Send that to the local LLM&lt;/li&gt;
&lt;li&gt;Receive:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight applescript"&gt;&lt;code&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="k"&gt;tell&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;application&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Finder"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nb"&gt;make&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;new&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;folder&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;at&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;desktop&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;with&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="na"&gt;properties&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"LlamaMagic"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="k"&gt;end&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;tell&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Run it instantly!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You just spoke an idea and your Mac obeyed like a friendly genie 🧞‍♂️&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 Bonus Tips
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;You can &lt;strong&gt;change the prompt&lt;/strong&gt; to ask for shell scripts, Python, or whatever!&lt;/li&gt;
&lt;li&gt;Add more automation, like asking for confirmation before running&lt;/li&gt;
&lt;li&gt;Use &lt;strong&gt;clipboard&lt;/strong&gt; instead of voice if you're shy 😅&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🥳 Final Thoughts
&lt;/h2&gt;

&lt;p&gt;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!&lt;/p&gt;

&lt;p&gt;All you need is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ollama 🦙&lt;/li&gt;
&lt;li&gt;A Shortcut ⚡&lt;/li&gt;
&lt;li&gt;Voice Control 🎙️&lt;/li&gt;
&lt;li&gt;A little creativity 💡&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now go impress your friends and make your Mac say &lt;strong&gt;"Your wish is my command."&lt;/strong&gt; 😄&lt;/p&gt;




&lt;p&gt;If you liked this guide, share it with your geeky friends 🧙‍♀️ and tell them:  &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“You don’t need Siri. You need Shortcuts + Ollama!”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Need help setting it up? Drop your questions below! 💬👇&lt;/p&gt;

</description>
      <category>ios</category>
      <category>apple</category>
      <category>shortcuts</category>
      <category>ai</category>
    </item>
    <item>
      <title>Helo</title>
      <dc:creator>ijayasurya</dc:creator>
      <pubDate>Sun, 15 Aug 2021 09:55:34 +0000</pubDate>
      <link>https://dev.to/ijayasurya/helo-c7a</link>
      <guid>https://dev.to/ijayasurya/helo-c7a</guid>
      <description></description>
    </item>
  </channel>
</rss>
