I have been copying SQL queries into Microsoft Word documents lately. The problem: when you copy from DataGrip, DBeaver, or Visual Studio Code, the paste retains the formatting. Font colours, background colours, the whole lot. I just want plain text.

I tried a few workarounds:

  • For single lines: paste into a browser address bar, then copy again
  • For multi-line queries: use TextEdit’s ‘Make Plain Text’ option, then do the same double-copy trick

Both work, but they are tedious.

What I wanted was a keyboard shortcut that strips formatting from whatever is already on the clipboard, whilst keeping indentation intact.

I looked around:

  • A thread on discussions.apple.com had no solution I was happy with. Command-Option-Shift-V had issues.
  • FormatMatch looked promising but only runs on Intel Macs. I wanted something for Apple Silicon.
  • Clnbrd seemed excellent but had more features than I needed.

I had never written Swift or built a macOS app before. But if stripping clipboard formatting was not too difficult, I figured that armed with OpenAI Codex & Claude Code I could build a solution myself.

After a quick check with ChatGPT that purifying the clipboard is not a known challenging problem, I went to work. Six evenings later, PureClip existed.

Features#

  • Runs in the menu bar on macOS 13 Ventura or newer
  • Strips formatting whilst keeping line breaks and tabs
  • Configurable keyboard shortcut, notifications, and detab mode (expand tabs to 2/4/8 spaces)
  • Multiple languages: English, Spanish, French, German, Japanese, Simplified Chinese
  • Apple Silicon only
  • No external dependencies, just SwiftUI and AppKit

The actual coding took a few days. The rest of the time went into designing an icon and weighing up App Store distribution (USD $99 per year) versus self-publishing.

You can see a demo at github.com/rnsloan/pureclip. The installable DMG is at the bottom of github.com/rnsloan/pureclip/releases/tag/v1.0.0.

It is Apple Silicon only for now since FormatMatch already covers Intel Macs. But as there are no external dependencies, building for Intel would just mean changing the build configuration.

It was a fun exercise in solving a problem and learning a bit about Xcode, Swift, and distributing an OS X executable.