Apex just grew a native Rich Text Format writer. That means Markdown can become something macOS apps already understand: Pages documents, .rtf files, and — with a little pasteboard care — rich text you can drop straight into Mail.

Why RTF matters

HTML is great for the web. RTF is what a lot of Mac apps speak when you want styled text without leaving the Apple document world. Open an Apex RTF file in TextEdit or Pages and you get headings, bold/italic, links, lists, tables, and the rest — not a wall of angle brackets.

Basic conversion looks like this:

apex notes.md -t rtf -o notes.rtf

Or pipe Markdown in:

pbpaste | apex -t rtf -o /tmp/out.rtf

That .rtf is a real document. Double-click it, drag it into Pages, attach it, archive it — whatever your workflow needs.

Clipboard and Mail

pbcopy auto-detects an RTF header ({\rtf…) and puts rich text on the pasteboard — you do not need a temp-file/osascript dance:

apex document.md -t rtf | pbcopy

From Markdown already on the clipboard:

pbpaste | apex -t rtf | pbcopy

Paste into Mail (or Notes, Pages, TextEdit — wherever rich paste works) and you should get formatting, not markup.

One trap: Automator’s “output replaces selected text” is plain text only. If a Service prints Apex’s RTF to stdout, Mail pastes the literal {\rtf1…} source. And pbpaste -Prefer rtf often comes back empty when the board is RTF-only — so you can’t round-trip rich text through shell stdout either.

Quick Actions and Shortcuts

The workable pattern for in-place conversion (Mail compose, Pages, TextEdit, etc.) is:

  1. Convert the selection with apex -t rtf
  2. pbcopy the RTF onto the pasteboard
  3. Simulate Cmd+V with System Events

I’ve thus far had mixed results with doing this via Services. You can see and example and a short README live in the repo under examples/quick-actions/.

Shortcuts works better. Try this Shortcut in Mail with Markdown text selected.

Install or update with Homebrew

brew tap ttscoff/thelab
brew install ttscoff/thelab/apex

Already have it?

brew update && brew upgrade apex

Source, issues, and releases live on GitHub: ApexMarkdown/apex.

Bonus: Bear / Panda image attributes

While we’re in “plays nice with Mac writing apps” territory: Bear (and Panda) store image size and related metadata as a JSON HTML comment glued to the image:

![](emperor-1.jpg)<!-- {"width":259} -->

Apex reads those Bear-style comments in CommonMark, GFM, MultiMarkdown, and unified modes and applies the attributes when rendering (the comment is preserved in HTML output). So notes that started life in Bear don’t lose their image sizing when you process them with Apex — including when you’re heading toward HTML today, and richer document targets as that path matures.

Try it

apex README.md -t rtf -o README.rtf
open README.rtf

If you build something cool with the Quick Action or Shortcuts side of this, I’d love to hear about it.