Export Notes as Markdown in MacOS Tahoe

Export multiple notes as Markdown and keep the history in Git.

Yesterday I completed a nuke-and-pave upgrade to MacOS Tahoe on my main workstation.

My favorite feature so far is the ability to export notes to Markdown. It even exports the attachments. Sweeet! Many thanks to the folks responsible for this improvement!

The best part is being able to select multiple notes and export them in a single operation. I typically export my changed notes a few times per week and keep the history in git, and this makes the workflow really simple.

Exporting notes is many times faster in Tahoe. I was able to export hundreds of notes in under a minute!

It is a bit strange that the operation requires typing in a target directory name given that you also have to select a target directory. I created a little script that lives in the root directory of my git project and uses the default target directory name (Archive) to move all the files and attachments up into the project root and commit the changes.

#!/usr/bin/env bash

set -o nounset -o errexit -o pipefail -o errtrace
trap 'echo EXITED: "${BASH_SOURCE}" "${LINENO}"' ERR

if [ -r Archive/Attachments ]; then
    rsync -av Archive/Attachments/* Attachments/
    rm -rf Archive/Attachments
fi

if [ -r Archive ]; then
    for file in Archive/*; do
        if [ -s "$file" ]; then
            mv -v "$file" ./
        else
            echo "$file IS EMPTY, SKIPPING!!!"
        fi
    done
    rm -rf Archive
fi

git add -A .
git status

git commit -m "updates"

Beware–there is no progress bar displayed in notes as the files are being exported. If you watch the activity in the directory (e.g. with "fswatch -r -v /path/to/notes-backups-r0ot"), you'll see the export continues to run silently in the background, sometimes for more than a minute.

So, after running the export in Notes, wait for a minute or two before running the script. If you run the script before notes is done processing the files, then you'll end up with files with unexpected names. For example, if the filename doesn't end in a number, it will get a '1' appended. If the filename already ends in a number, that number will get incremented (which can produce problematic results, e.g. a note named 'Jan 2025' could end up getting exported to a file named 'Jan 2026.md').

Update 2026.01.11 - Tahoe 26.2

I didn't see any changes related to Notes or Markdown in the Tahoe 26.2 release notes. But I updated my workstation to Tahoe 26.2 today, and based on the git history, I'm noticing a few changes in the Markdown being generated when I export files.

  • Text that was highlighted in Notes is no longer showing up as highlighted in Markdown. It's worth noting that there is a bit of a mismatch between the highlighting in Notes and the highlighting in Markdown. In Notes, you can choose one of 5 different highlight colors, but in Markdown, highlighting is just a single property that can be enabled. To illustrate this, you can export a note containing multiple highlight colors to markdown, and then import the exported markdown file back into notes, and you'll only see one highlight color in the newly imported note.
  • There appear to be some changes to attachments filenames. I recently exported some notes with attachments, and the filenames used for the export matched the name of the attachment. After the update, the note is unchanged, but the export filenames appear to be uuids. This is a great change because it avoids collisions when there are multiple attachments with the same name.
  • It seems to be taking a fair amount longer time for the export to complete. I'm seeing a lot of instances where I waited for a minute or two and thought it was done, so I ran my script to check in the changes. But then when I came back later, I see that not everything was checked in because files were still being generated. This makes it more frustrating that there is no visibility into the progress.

Still some issues...

See also: my list of Issues and Annoyances with the MacOS Notes App (these were previously included in this post, but I broke it out into a separate post since it was pretty long and not related to markdown export).

One minor annoyance I've seen in Tahoe is that if I have selected a note to export that is currently locked, then when I run the export, the note will get exported as an empty file. So, I updated the script to skip empty files so it doesn't replace the file in git with an empty one.

Also, if I export all my notes multiple times, I get different results. Update: this one appears to have been fixed in Tahoe 26.2 due to switching the filenames to uuids (see above). I've tried this by selecting all notes and exporting to a directory called Archive1, and then leave the same notes selected and immediately export to a directory called Archive2. When I do this, I get different results as show by "diff -r --brief Archive1 Archive2". This mostly seems to be due to attachments that have the same name. In some exports you get one of the attachments, and in some exports, you end up with a different one. I believe most of the name collisions I'm seeing were created when I took multiple pictures using the camera from within Notes to the same note. If you grep for the attachment file name in the exported files, you can see where the duplicates are referenced (note that some characters are percent encoded in the filename, e.g. space is %20).

Occasionally when I export files, some of the files end up with a bunch of duplicated lines. I haven't been able to reproduce this consistently.

There is a bug where the export operation just fails. When this happens, if you select one or more notes and choose File => Export as => Markdown, then the progress bar will come up as it processes the files, but then it will just play an error sound and halt the export operation without any error message. This happens pretty consistently if I've had Notes open for more than a few hours, but I've also seen it happen when Notes has only been open for a few minutes. I've noticed this tends to happen if I have brought up the font (⌘T) or color (⌘C) dialogs, but I haven't been able to identify a specific sequence of actions to reliably recreate it. The same issue happened when trying to export in Sequoia. Once it fails, it seems to reliably fail every time until I quit. Closing and reopening Notes seems to be the only way to resolve the issue.