Type in a new MarkEdit note and your text is on disk a few seconds later, in a file
named Untitled-2026-08-22-092412.md. No save dialog, no naming it, no thinking
about it.
MarkEdit already has editor.autoSaveWhenIdle, but it deliberately skips untitled
documents:
// EditorDocument.swift
var shouldSaveWhenIdle: Bool {
// Saving documents without a fileURL would bring up the dialog
AppRuntimeConfig.autoSaveWhenIdle && fileURL != nil
}So a brand-new note is the one thing MarkEdit never autosaves — and with
editor.closeAlwaysConfirmsChanges off, closing that window discards it without
asking. TrueSave covers exactly that gap.
While a document is untitled, TrueSave mirrors its text to a file a few seconds after you stop typing. The same file is reused for the life of that window.
It is a safety net, not a rename. The window still says Untitled — Edited,
because MarkEdit still considers the document unsaved. Your words are on disk; the
document just doesn't know about it.
Making the document itself become that file is not possible from an extension. A
document only gets a fileURL via openFile (which routes through LaunchServices
to whatever app owns .md) or saveDocument (which opens a modal save panel on an
untitled document). Neither is silent, so TrueSave doesn't try.
- Copy
true-save.jsinto:~/Library/Containers/app.cyan.markedit/Data/Documents/scripts/ - Optionally pick a folder in
settings.json(Shift-Command-Comma):
{
"trueSave.folder": "~/Notes"
}- Restart MarkEdit.
No other settings are required. editor.autoSaveWhenIdle is unrelated to TrueSave —
it covers documents that already have a file, TrueSave covers the ones that don't.
| Key | Default | Meaning |
|---|---|---|
trueSave.folder |
~/Documents |
Where notes are written. ~ is your real home, not the sandbox container. |
trueSave.delay |
3000 |
Milliseconds of no typing before a write. |
- The filename is picked once per window, on the first write, and reused after that — you get one file per note, not one per idle.
- A path that already exists is never touched; TrueSave falls back to
Untitled-<date>-<time>-2.md. - If you empty the note, the file is emptied too. The file tracks the document.
- If you later
Cmd+Sthe note under a real name, TrueSave stops and MarkEdit's own autosave takes over — but the mirrored copy stays behind as a leftover. - If the folder isn't writable you get one alert explaining how to grant access, and TrueSave stops. It never fails silently.
- The last few seconds aren't on disk. Writes happen
trueSave.delayms after you stop typing. Lower it if that window bothers you. - Leftovers. A mirrored file is not cleaned up if you later save the note elsewhere.
- Sandbox. MarkEdit ships a home-relative read-write exception, so most folders under your home work without a grant. If yours doesn't, the alert tells you.
- No version history on the mirror. MarkEdit's "Browse All Versions" is
NSFileVersion, which macOS records when anNSDocumentsaves. TrueSave writes throughFileManager, so no snapshots are taken. The mirror protects you from losing the window, not from overwriting your own text —Cmd+Zin the editor is still the only undo.
node test.jsRuns true-save.js in a vm with a stubbed MarkEdit global: path and timestamp
format, ~ expansion, path reuse across writes, collision suffixes, and the
blank / already-titled / denied-folder cases.