---
title: "AI Text Snippets on Mac: Rewrite Selected Text With a Keystroke"
description: "AI text snippets transform selected text in place - tap right Command to fix grammar, change tone, or summarize. Runs on your Mac, no cloud, free download."
date: 2026-05-16
author: "Ben Racicot"
tags: ["AI", "Snippets", "Text Expander", "Privacy", "macOS", "Apple Silicon", "Productivity"]
type: "article"
canonical: "https://modelpiper.com/blog/ai-text-snippets-mac"
---

# AI Text Snippets on Mac: Rewrite Selected Text With a Keystroke

> AI text snippets transform selected text in place - tap right Command to fix grammar, change tone, or summarize. Runs on your Mac, no cloud, free download.

## TL;DR

AI text snippets transform the text you've selected instead of expanding an abbreviation into stored text. Select a paragraph in any app, tap the right Command key, and a local model rewrites it in place - fix grammar, make it formal, condense to a TLDR. ToolPiper tries Apple's on-device model first, falls back to a local LLM, and 12 transforms ship built in. The text never leaves your Mac. Free download (DMG), macOS 26+, Apple Silicon.

A normal text snippet is a trade: you memorize a short trigger, the expander pastes a longer block of text you saved earlier. Type `;addr`, get your mailing address. The text is fixed. You wrote it once, and the snippet just recalls it.

**AI text snippets work the other way around. The input is the text you already wrote, and the snippet rewrites it.** Select a clumsy sentence, tap a key, and it comes back fixed. Select a blunt email, tap a key, and it comes back polite. There's nothing stored ahead of time. The snippet is a transform, not a recall.

That difference is the whole point of this article, so it's worth being precise about it. Static expansion turns a short string into a longer string you defined. **An AI text snippet takes whatever you selected and returns a changed version of it** - grammar fixed, tone shifted, length cut. In ToolPiper, you select text in any app, tap the right Command key, and a language model running on your Mac replaces the selection with the rewrite. I use the grammar-fix one a few dozen times a day without thinking about it, which is the real test for this kind of feature - it has to be faster than the thing it replaces, or you go back to the old way.

## What are AI text snippets?

AI text snippets are keyboard-triggered text transforms. You select text, press a trigger, and a language model rewrites the selection in place. Unlike static text expansion, which pastes pre-written text from an abbreviation, an AI snippet takes your selected text as input and returns a modified version - corrected grammar, a different tone, a shorter summary.

The mechanism is what separates them from both classic expanders and from a chat window. A classic expander like a stored `;sig` signature has one job, which is to match a trigger and paste the saved text. It can't reason about what you wrote. A chat window can reason, but it lives in another app. You copy, switch, paste, prompt, copy the answer, switch back, then paste again. The AI snippet collapses that loop into one keystroke and keeps you in the document you're already editing.

The category name is new because the capability is new on the desktop. Apple's Writing Tools, Grammarly, and a handful of editor plugins all do versions of "rewrite what I selected," which tells you the demand is real. What's different here is where the model runs and how much of the trigger surface you control, which is the rest of this article.

## Why does AI on selected text beat static expansion?

AI on selected text beats static expansion because the input is dynamic - the model reworks whatever you actually wrote, instead of recalling text you saved earlier. Static snippets can only insert fixed strings. An AI snippet can fix grammar, change tone, or summarize text it has never seen before.

Static expansion is great at exactly one thing, the text you type the same way every time. Your address. A boilerplate reply. A code template. For those, a stored snippet is faster and more reliable than any AI, and you should keep using it. We're not replacing that.

The gap shows up the moment the text changes. You can't pre-store "fix the grammar in this paragraph" because you don't know what the paragraph will say. You can't pre-store "make this email sound less annoyed" for every email. That's the work an AI snippet does - it reads the live selection and rewrites it. **Static snippets recall what you saved. AI snippets rework what you just wrote.** The two solve different problems, and a good setup uses both. Stored snippets handle the fixed stuff, AI snippets handle everything that's different every time.

## Why does running it locally matter?

Running text transforms locally matters because the text you rewrite is often the text you'd least want to send to a server - draft emails, client notes, source code, half-finished arguments. With a local model, the transform runs on your Mac and the text never crosses the network, which you can confirm by watching network traffic while a snippet fires.

Think about what you actually reach for a rewrite on. It's rarely a grocery list. It's the reply to a difficult client, the bug writeup with the internal system names in it, the paragraph of a contract you're not sure reads right. Cloud rewrite tools take that exact text and POST it to a server you can't inspect. Their privacy policy might be excellent. The text still left your machine, and there's no way for you to audit what happened to it after it arrived.

ToolPiper's text AI runs on your Mac. The transform goes to Apple's on-device model or to a local LLM that ToolPiper hosts on the loopback interface, and the rewritten text comes back without a network call. That's not a promise in a policy document - it's an architectural fact you can check yourself with a packet inspector. The structural point is simple. A tool that does the work locally has nowhere to send your text, so the question of what a server does with it never comes up. This is the same local-first argument we make across the whole [local-first AI on macOS](/blog/local-first-ai-macos) series, applied to the text you select.

## How does the right-Command tap work?

You select text in any app, then press and release the right Command key in under 250 milliseconds. ToolPiper captures the selection, sends it to a transform (grammar fix by default), and replaces the selected text with the rewritten result. The tap is distinct from holding the key, so a normal Command shortcut still works.

The press-and-release timing is deliberate. A held right Command is still your normal modifier - it does nothing to your selection. A quick tap, under 250ms, is the snippet trigger. That gap is how the same physical key serves both jobs without one stepping on the other.

What happens when you tap is a two-tier model decision. **ToolPiper tries Apple's on-device model first** through the Foundation Models framework, because for short text it's fast and already loaded. If the input is too long for the on-device model, or it declines the request, ToolPiper falls back to its own local LLM over the loopback interface - the same engine that runs your local chat. Both paths run on your Mac. You don't pick the tier. ToolPiper routes based on the input, and either way the text stays local.

The selection is the only input. The action pipeline never reads your clipboard, so whatever you have copied stays untouched and out of the transform. If the selection is empty, the output comes back empty, or the selection is larger than 16,384 characters, ToolPiper refuses the transform and leaves your text alone rather than guessing.

## What transforms ship by default?

ToolPiper ships 12 built-in transforms: ;fix, ;formal, ;casual, ;concise, ;expand, ;simplify, ;bullets, ;summary, ;tldr, ;active, ;email, and ;rewrite. Each takes your selected text and returns a rewritten version - corrected, retoned, restructured, or condensed - in place.

The defaults cover the rewrites people reach for most. `;fix` corrects grammar and spelling. `;formal` and `;casual` shift tone in either direction. `;concise` and `;expand` change length. `;simplify` drops jargon, `;active` kills passive voice, `;bullets` turns prose into a list, `;summary` and `;tldr` condense, `;email` shapes a note into a sendable message, and `;rewrite` is the general-purpose pass.

These aren't a fixed menu. Each one is a prompt plus a trigger, and you can edit them or add your own - your prompt, your trigger, run against your chosen local model. That's the line between this and the built-in rewrite menus on macOS. You define the transform, not the vendor.

## Can you chain transforms together?

Yes. Writing two triggers like ";fix ;formal" runs them in document order - first the grammar fix, then the formal rewrite - up to a cap of 4 stages. If any stage returns empty output, the chain aborts and your original selection is preserved untouched.

Chaining is how you compose a transform you didn't pre-define. "Fix the grammar, then make it formal" is two passes, written as `;fix ;formal`, run left to right. You can stack up to four stages, which is enough to fix, retone, and condense in a single trigger without building a custom prompt for that exact combination.

The abort behavior is the important part. If stage two comes back empty - the model returned nothing usable - the chain stops and your selection is restored to what it was before you tapped. **A failed chain never leaves you with half-transformed or empty text.** That's a deliberate fail-safe. A rewrite that can silently eat your paragraph is worse than no rewrite at all.

## Can you trigger snippets by voice?

Yes. You can say "use the fix snippet" or speak the literal trigger, and ToolPiper runs that transform on your selected text. These explicit voice paths are deterministic single-model-call routes, the same as tapping the key.

Voice dispatch has two solid tiers today. The first is an explicit instruction - "use the fix snippet" - which names the transform directly. The second is a literal trigger or set voice phrase that maps one-to-one to a snippet. Both resolve to a single model call and behave exactly like the keystroke. If you've already got [push-to-talk dictation](/blog/push-to-talk-ai-mac) set up, this is the same muscle. Hold to speak, and the snippet fires on what you selected.

A third tier - falling back to the chat engine to interpret looser phrasing and dispatch a transform through tool calls - is in beta now. It depends on the agentic chat work landing, so treat it as coming rather than shipped. Semantic dispatch, where a paraphrase like "clean this up" is matched to the right snippet through embeddings, is planned and not shipped yet either. The deterministic voice tiers are the ones to rely on today.

## How does it know when not to fire?

Before it captures a selection, ToolPiper probes the focused element's accessibility role and refuses secure or password fields. If accessibility is denied or the probe times out at 250 milliseconds, it fails closed and does nothing - it never transforms text it can't confirm is safe.

A rewrite tool that fired inside your password manager would be a disaster, so the action pipeline checks first. It reads the accessibility role of whatever element has focus, and if that's a secure text field, it refuses. The check is fail-closed. If accessibility permission is missing, or the role probe doesn't answer within 250ms, ToolPiper declines rather than risking a transform on a field it couldn't verify. Erring toward doing nothing is the right default for something that edits text in place.

Trigger matching is just as careful. A trigger only fires when it's flanked by whitespace or punctuation, so `;fix` expands as a word boundary and never fires inside `;fixed`. Push-to-talk dictation, voice chat, and snippet expansion are mutually interlocked, so two of them can't grab the same keystroke and collide. The design goal across all of it is that the feature stays out of your way until you clearly ask for it.

## How does it compare to other AI rewrite tools?

ToolPiper is the only one of these tools that lets you define your own prompts, chain transforms, and run a model of your choice fully on your Mac. Apple Writing Tools and Grammarly use fixed presets and route some or all text to a server, and Raycast AI lets you write commands but runs them in the cloud.

Several tools now rewrite selected text. The differences are about who controls the prompt, where the model runs, and how you invoke it. Competitor pricing below is as of May 2026 and may have changed since.

## What are the limits?

This is a transform tool, not a generator. AI text snippets rework text you've selected - they don't write a paragraph from a blank cursor. If you want the model to draft something from nothing, that's a chat task, not a snippet task. The snippet pipeline needs a non-empty selection to act on, by design.

Injection doesn't work everywhere. Most standard macOS text fields accept the replacement cleanly, but some Electron apps, terminal emulators, and apps with custom text rendering handle input in non-standard ways and may not take the injected result. When that happens the transform still ran - you just may need to paste manually rather than getting an in-place replace. It's the same constraint every accessibility-based text tool on macOS runs into, which is why tools like this ship outside the App Store sandbox in the first place.

The looser voice path is still beta. Tier-1 and tier-2 voice dispatch - explicit instructions and literal triggers - are solid and deterministic today. The tier-3 chat fallback that interprets vaguer phrasing through tool calls is in beta now and depends on the agentic chat work. Semantic snippet matching is planned, not shipped. And the secure-field check is reactive. It probes the focused field when you trigger, and it doesn't pre-scan every field on screen before you act.

## How do you set it up?

Download ToolPiper from [modelpiper.com](https://modelpiper.com) (DMG). It's a free download and requires macOS 26 or later on Apple Silicon (M1 or newer). ToolPiper isn't on the Mac App Store because the Accessibility and CGEvent APIs that read your selection and inject the rewrite are incompatible with the App Store sandbox - the same reason TextExpander, Raycast, Alfred, and Keyboard Maestro all ship outside it.

On first launch, grant Accessibility permission. That's what lets ToolPiper read the focused element's role (so it can refuse secure fields) and replace your selection with the rewrite. The 12 transforms work out of the box. Select some text, tap right Command, and the grammar fix runs. Edit the prompts or add your own triggers from settings when you want transforms specific to your work.

_This is part of a series on [local-first AI workflows on macOS](/blog/local-first-ai-macos) and the [text and clipboard workflow roundup](/workflow/text-clipboard). Next up: [local text expansion on Mac](/blog/text-expander-mac-local) - the static-snippet side of the same engine, dynamic dates, cursor placement, and importing your existing library._

## FAQ

### What's the difference between AI text snippets and a normal text expander?

A normal text expander pastes a fixed string you saved earlier - type `;addr`, get your stored address. An AI text snippet does the opposite: it takes the text you've selected as input and returns a rewritten version, like fixing grammar or changing tone. The expander recalls pre-written text. The AI snippet reworks text it has never seen before. Most setups use both - static snippets for fixed text, AI snippets for everything that's different each time.

### Does my text get sent to the cloud?

No. ToolPiper runs the transform on your Mac - first through Apple's on-device model, then through a local LLM that ToolPiper hosts on the loopback interface if the on-device model declines or the input is too long. Neither path makes a network call, so the text you rewrite never leaves the machine. You can confirm this yourself by watching network traffic while a snippet fires.

### Can I write my own transforms?

Yes. Each of the 12 built-in transforms is a prompt plus a trigger, and you can edit them or add your own from settings. Your prompt, your trigger, run against your chosen local model. This is the main difference from the fixed rewrite menus built into macOS - you define the transform instead of the vendor.

### How do I trigger an AI snippet?

Select text in any app, then tap and release the right Command key in under 250 milliseconds. ToolPiper captures the selection and replaces it with the rewrite - the grammar fix by default. Holding the key still works as a normal Command modifier, so the tap is what distinguishes a snippet from a shortcut. You can also trigger by voice with an explicit instruction like "use the fix snippet."

### Will it accidentally rewrite text in my password manager?

No. Before it captures a selection, ToolPiper probes the accessibility role of the focused element and refuses secure or password fields. The check is fail-closed: if accessibility permission is missing or the probe times out at 250 milliseconds, it does nothing rather than risk transforming a field it can't confirm is safe.

### Can I chain transforms?

Yes. Writing two triggers together, like `;fix ;formal`, runs them in document order - grammar fix first, then formal rewrite - up to a cap of 4 stages. If any stage returns empty output, the whole chain aborts and your original selection is preserved untouched, so a failed chain never leaves you with empty or half-rewritten text.

### Can it generate new text from scratch?

No. AI text snippets are transforms, not generators - they rework text you've selected and need a non-empty selection to act on. To draft something from a blank cursor, use chat instead. The snippet pipeline refuses empty selections, empty outputs, and selections larger than 16,384 characters by design.

### Why isn't ToolPiper on the Mac App Store?

ToolPiper uses Accessibility APIs to read your selection and CGEvent APIs to inject the rewrite, both of which are incompatible with the Mac App Store sandbox. This is the same reason TextExpander, Raycast, Alfred, and Keyboard Maestro all distribute outside the App Store. ToolPiper is a free DMG download from modelpiper.com and requires macOS 26 or later on Apple Silicon.
