Daring Fireball

★ AppleScript: ‘Save MarsEdit Document to Text File’

Brief

John Gruber describes a small but practical workflow automation: an AppleScript that exports the current MarsEdit draft window to a plain text file. The script fills a gap in MarsEdit’s feature set, which preserves unpublished posts only inside its Local Drafts library rather than as standalone files. Gruber’s version is tuned to his publishing stack—MarsEdit for composing most short posts, BBEdit for deeper revision work, Dropbox for file storage, and Movable Type conventions for URL slugs. Invoked through FastScripts with an Option-Command-S shortcut, the script presents the standard macOS save sheet, proposes the post title as the filename, and writes out both metadata and body content in a readable text format. A subtle implementation detail is that “Slug” is sourced from MarsEdit’s Keyword field, not the app’s native Slug field. The utility was enough to help him archive 29 stale drafts and empty his Local Drafts library.

Why it matters

John Gruber wrote an AppleScript on 2026-03-19 to add a de facto “Save as Text File…” capability to MarsEdit, which otherwise only supports saving unpublished work as internal “Local Drafts.”

Key details

  • The script can be launched from MarsEdit via Red Sweater Software’s FastScripts and assigned the standard save-style shortcut Option-Command-S; it opens the macOS Save dialog, defaults the filename to the post Title field when present, and benefits from AppleScript’s built-in memory of the last save location.
  • Exported files include structured frontmatter-style metadata such as Title, Blog, Edited timestamp, Tags, Slug, and Excerpt, followed by the body text separated by a --- delimiter.
  • Gruber’s implementation maps the displayed “Slug” line to MarsEdit’s Movable Type-compatible Keyword field rather than MarsEdit’s optional native Slug field, which he keeps hidden for historical workflow reasons.
  • The script let Gruber clear out 29 lingering MarsEdit drafts, some years old, moving them into Dropbox-hosted plain text files for longer-term storage and later editing in BBEdit.
Source evidence

title: ★ AppleScript: ‘Save MarsEdit Document to Text File’
author: John Gruber
contenttype: article
publication: Daring Fireball
published: 2026-03-19T16:46:37+00:00
source
url: https://daringfireball.net/2026/03/applescriptsavemarseditdocumenttotextfile

word_count: 659

Here’s a simple AppleScript I wrote this week — one that solves a minor itch I’ve had for, jeez, 20 years. Almost every item I post to Daring Fireball goes through MarsEdit , the excellent Mac blogging client from Red Sweater Software (my friend Daniel Jalkut ). MarsEdit has a built-in “local drafts” feature, where you can save unpublished drafts within a library in MarsEdit itself. It doesn’t happen often but I occasionally wind up with partially written posts that I don’t publish, but don’t want to throw away. But I don’t really want to keep them in MarsEdit. I want them saved as text files. For me, those text files go in a folder in Dropbox. For someone else, maybe they go in iCloud Drive. I write my longer posts in BBEdit , and then copy them into a MarsEdit document when they’re ready to publish. My shorter posts — which is most of them — are usually entirely composed in MarsEdit. Any abandoned drafts that I might return to, I probably want to compose in BBEdit, because the reason they’re abandoned is that they need to be longer. Or they need to be shorter. But either way they need more thought, and BBEdit is where I go to do my most concentrated thinking. MarsEdit doesn’t have a built in way to save a document window as a text file. Just its built-in “Save as Local Draft” feature. I didn’t merely suspect but knew that it’d be relatively easy to write an AppleScript to add a “Save as Text File…” feature to MarsEdit, which I could invoke within MarsEdit from FastScripts , the system-wide scripts menu utility that is also from Red Sweater/Jalkut, and, using FastScripts, I could even give the script the standard keyboard shortcut Option-Command-S. ( Or is it Command-Option-S?) It’ll take a window like this: and then prompt you with a system Save dialog to enter a filename (defaulting to the Title field contents, if any, in the MarsEdit document) and location to save the text file. AppleScript even conveniently remembers the last place you saved a file, so it defaults to last place you saved a file the next time you invoke it, with the script doing any work to remember that. The text file looks like this: Title: AppleScript: 'Save MarsEdit Document to Text File'
Blog: ★ Daring Fireball
Edited: Thursday 19 March 2026 at 12:16:29 pm
Tags: AppleScript, MarsEdit
Slug: AppleScript: 'Save MarsEdit Document to Text File'

Excerpt:

[Here's a simple AppleScript I wrote this week][s] -- one that
solves a minor itch I've had for, jeez, 20 years. Almost every
item I post to Daring Fireball goes through [MarsEdit], the
excellent Mac blogging client from Red Sweater Software (my
friend [Daniel Jalkut]). ... That’s it. If you use MarsEdit, maybe it’ll help you. I picked the document fields in MarsEdit that I use (Title, Tags, Excerpt, etc.). One potential point of confusion is that while MarsEdit has an optional document field named “Slug”, I don’t use it. For historical reasons, I use Movable Type’s “Keyword” field for the words I want to use for the URL slug for each post. So in my text files, where it says “Slug:”, the text after that label comes from MarsEdit’s Keyword field. And I keep MarsEdit’s actual Slug field hidden, because I don’t use a field with that name in Movable Type. Your mileage, as ever, may vary. But this makes total sense to me . Anyway, this script helped me clean up 29 drafts, some of them years old, that had been sitting around in MarsEdit, bugging me. Now my “Local Drafts” library in MarsEdit is empty, and those drafts are safe and sound in text files in Dropbox. When something in your workflow is bugging you, you should figure out a way to address it. Why I didn’t write (and share) this script years ago is a mystery for the ages.