How to Use AI Auto-Correct in ANY Mac App (Works Everywhere)

Dave EbbelaarAbout 4 min readMay 27, 2025Watch original
THE SUMMARYAI-generated

Key Concepts

  • AI-powered autocorrection
  • Alfred workflow automation
  • OpenAI API integration
  • Python scripting
  • Productivity enhancement

Setting up AI Autocorrect on Mac with Alfred

Introduction

The video demonstrates how to set up an AI-powered autocorrection tool that works across all applications on a Mac using Alfred, a productivity application. This eliminates the need to copy and paste text into separate AI tools like ChatGPT. The solution involves creating a custom automation workflow within Alfred, leveraging Python scripting and an API from a large language model provider like OpenAI.

Prerequisites

  1. Python 3 Installation: Required for running the script within Alfred. Installed via command line tools.
  2. Alfred: A productivity application for Mac. A free version is available, but the "Powerpack" is required to use workflows.
  3. Alfred Powerpack: A paid upgrade to Alfred (single license currently £34) that enables workflow functionality.
  4. API Key: An API key from a large language model provider (OpenAI or Anthropic) is needed to access the AI model.

Step-by-Step Installation Process

  1. Install Python 3 via Command Line Tools:
    • Open the Terminal application.
    • Run the command: xcode-select --install (This installs developer tools, including Python 3).
    • Run the command: pip3 install requests (This installs the "requests" library, used for making API calls).
    • Note: Even if Python is already installed, these steps are crucial as Alfred uses this specific version.
  2. Install Alfred:
    • Download and install Alfred from the official website.
  3. Purchase and Activate Alfred Powerpack:
    • Purchase the Alfred Powerpack license.
    • Activate the Powerpack within the Alfred preferences.
  4. Obtain an OpenAI API Key:
    • Create an account on the OpenAI platform.
    • Generate a new secret key (e.g., "test").
    • Important: Keep the API key secret.
  5. Download the Alfred Workflow:
    • Download the "OpenAI Spell Fixer Alfred Workflow" file from the provided GitHub repository link.
  6. Import the Workflow into Alfred:
    • Double-click the downloaded workflow file. This will open Alfred and prompt you to install the workflow.
    • Click "Install" in the Alfred window.
  7. Configure the Workflow:
    • Set the Hotkey:
      • Double-click the "Hotkey" trigger in the workflow.
      • Click inside the "Hotkey" text field.
      • Enter a desired key combination (e.g., Option + Backslash).
      • Click "Save."
    • Update the OpenAI API Key Environment Variable:
      • Click the "Configure Configuration" button (the "x" button) in the top right corner of the workflow editor.
      • Go to the "Environment Variables" tab.
      • Double-click the "openai_api_key" variable.
      • Paste the OpenAI API key into the value field.
      • Click "Save."
    • Verify Python Script Settings:
      • Click the middle button (script filter) in the workflow.
      • Ensure the "Language" is set to "Python."
      • Verify that the Python path points to a Python 3 installation.
      • Review the Python code (optional) to understand the workflow logic.

Understanding the Python Script

The Python script performs the following actions:

  1. Loads Parameters: Retrieves the OpenAI API key and the chosen AI model.
  2. Defines System Prompt: Sets the instructions for the AI model (e.g., "Correct the spelling and grammar of the following text").
  3. Makes API Call: Sends the selected text to the OpenAI API for processing.
  4. Receives Corrected Text: Receives the corrected text from the OpenAI API.
  5. Pastes Corrected Text: Pastes the corrected text into the frontmost application.

The default model is "gpt-3.5-turbo-1106" (formerly "GPT-4.0 Mini"), a fast and cost-effective model for this use case. The system prompt can be customized to adjust the AI's behavior.

How to Use the Autocorrect Tool

  1. Select the text you want to correct in any application on your Mac.
  2. Press the configured hotkey (e.g., Option + Backslash).
  3. The corrected text will automatically be pasted, replacing the original text.

Important Note: Avoid immediately clicking elsewhere after pressing the hotkey, as the corrected text will be pasted at the cursor's location.

ClickUp Sponsorship

The video is sponsored by ClickUp, a project management and collaboration platform. The presenter highlights ClickUp's features, including project management, document management, timelines, and integrations with tools like GitHub. He emphasizes that ClickUp helps consolidate tasks, projects, and documents into a single application.

Conclusion

The video provides a detailed guide on setting up an AI-powered autocorrection tool on a Mac using Alfred, Python, and the OpenAI API. This setup allows for system-wide autocorrection, improving productivity by eliminating the need to switch between applications and AI tools. The presenter also recommends ClickUp as a tool for further productivity enhancement.

AI summaries can miss context or contain errors. Check important details against the original video.

Go a little deeper.

Have a question about this video? Load its transcript to open the video chat.