Animated data flow diagram

AI Text Enhancement Agent for Apple Shortcuts

Version: 1.0.0 | Last Updated: 2025-05-16

Integrates with:

OpenAI Apple Shortcuts

Overview

Unlock On-Demand Text Superpowers with this AI Agent

This AI Agent seamlessly integrates advanced text manipulation capabilities from OpenAI directly into your Apple Shortcuts. Imagine selecting text anywhere on your Mac, iPhone, or iPad, hitting a keyboard shortcut, and instantly having it translated, grammar-checked, shortened, or expanded. This n8n workflow acts as the intelligent backend, receiving requests from your Apple Shortcuts, processing the text with specific AI instructions, and returning the enhanced content right back to your clipboard or active application.

Key Features & Benefits

  • Versatile Text Abilities:
    • Translation: Convert text to English or Spanish (easily extensible to other languages).
    • Grammar Correction: Polish your writing by fixing grammatical errors and typos without altering meaning.
    • Summarization: Condense text to make it slightly shorter (e.g., ~5% reduction).
    • Expansion: Elaborate on text to make it slightly longer (e.g., ~5% expansion).
  • AI-Powered Precision: Leverages OpenAI's GPT models (e.g., gpt-4o-mini by default) for high-quality text processing and expects JSON output.
  • Seamless Apple Shortcuts Integration: Works across your Apple ecosystem (Mac, iPhone, iPad), triggered by simple shortcuts you define.
  • Customizable Prompts: Tailor the AI's behavior by modifying system prompts within the n8n OpenAI nodes for each specific text task.
  • Increased Productivity: Automate common text editing tasks, saving you time and effort in your daily writing, communication, and content creation.
  • Centralized Logic: Manage all your text automation AI prompts and logic in one n8n workflow, easily callable from multiple Shortcuts.
  • Flexible Output: Designed to replace selected text, with considerations for handling rich formatting.

Important Notes

  • The workflow's 'Respond to Shortcut' node uses {{ $json.message.content.output.replaceAll('\n', "<br/>") }} by default for HTML-friendly line breaks. You might need to adjust this expression (e.g., to use \n for plain text newlines) depending on the primary applications you'll be using this with and how they handle pasted content.
  • This workflow serves as a foundational example. Feel free to duplicate branches and customize prompts in the OpenAI nodes to create new text automation capabilities.
  • The provided Apple Shortcut is a template. You can duplicate and modify it to create different shortcuts for different AI actions or to fine-tune its behavior.

Use Cases

  • Instantly translate selected text into English or Spanish while drafting documents or emails.
  • Quickly correct grammar and spelling in any application on your Apple device before sending or publishing.
  • Effortlessly shorten or expand text on-the-fly for social media posts, notes, or messages to fit length requirements.
  • Streamline content creation by integrating AI text editing directly into your existing writing workflow on Apple devices.

Prerequisites

  • An n8n instance (Cloud or self-hosted).
  • OpenAI API Key with access to a suitable model (e.g., gpt-4o-mini, gpt-3.5-turbo, or gpt-4).
  • An Apple device (Mac, iPhone, iPad) with the Shortcuts app installed.
  • On your Apple device: Settings > Shortcuts > Advanced, ensure 'Allow Running Scripts' is enabled.

Setup Instructions

  1. Download the n8n workflow JSON file.
  2. Import the workflow into your n8n instance.
  3. Configure each of the 'OpenAI' nodes (e.g., 'OpenAI - To Spanish', 'OpenAI - Correct Grammar', etc.) with your OpenAI API Key. You can also adjust the model (default is gpt-4o-mini) or the system prompts within these nodes to refine the AI's behavior.
  4. Activate the n8n workflow. Once active, copy the Webhook URL provided by the 'Webhook from Shortcut' node (under the 'Webhook URLs' section).
  5. Download the companion Apple Shortcut template.
  6. Install the downloaded Shortcut on your Apple device.
  7. Edit the imported Apple Shortcut: locate the 'Get Contents of URL' action (it's usually step 2). Paste your n8n Webhook URL (from step 4) into the URL field of this action, replacing the placeholder.
  8. In the Apple Shortcut's details (tap the 'i' icon or settings), you can assign a keyboard shortcut for quick activation on Mac, or configure it for Share Sheet/Widgets access on iOS/iPadOS.
  9. Ensure 'Allow Running Scripts' is enabled in Settings > Shortcuts > Advanced on your Apple device.
  10. Test it out! Select some text in any application, trigger your Apple Shortcut using the method you configured (e.g., keyboard shortcut), and the AI-enhanced text should replace your selection or be available as per your Shortcut's configuration.
  11. (Optional) To add more text abilities, duplicate an existing OpenAI node branch in n8n, modify its prompt, update the Switch node, and create a corresponding Apple Shortcut.

Tags:

AI AgentAutomationOpenAIApple ShortcutsText ManipulationNLPProductivityGPT

Want your own unique AI agent?

Talk to us - we know how to build custom AI agents for your specific needs.

Schedule a Consultation