How to export a note as plain text file?

I would like to use notes as plain text files to edit them with

basic editor of text files like `vi` or `emacs` and to deal with

them with command line tools ( `grep`, `awk`, `perl`… ).


How may I perform such an export to either ISO-8859-15 or UTF-8 basic text format

which is a format I can use on all my environments ( mostly command line interface,

many macOS versions, Linux, FreeBSD… )?


A command line like `iconv` doesn't seem to be able to convert them.


iconv -f ISO-8859-1 -t UTF-8 my_note.txt >my_note.utf-8


produce a file which looks like utf-8 encoded, but is unreadable.


A simple copy-paste from `Notes` toward `vi` is working, but doesn't

scale on huge notes.


Any solution based on command line would be perfect.

A solution working on any version of macOS fromm Big Sur to Sonoma would

be preferred.


Thank you for any kind of help.



[Edited by Moderator]

MacBook Pro 15″, macOS 11.7

Posted on Nov 7, 2025 2:32 AM

Reply
Question marked as Top-ranking reply

Posted on Nov 7, 2025 3:37 AM

Notes can export as PDF or Markdown. That is it. Beneath what you see in Notes text is HTML markup.


Solutions:

  1. Copy the content in Notes to the clipboard. In the Terminal, use the pbpaste command to pipe that text (not html) to UNIX utilities. The mvim is a UNIX soft link to /Applications/MacVim.app/Contents/bin/mvim.
    1. pbpaste | vim -
    2. pbpaste | mvim -
  2. osascript
osascript -e 'tell application "Notes" to get plaintext of first note whose name contains "T-mobile"' | egrep -o '(\d+-\d+-\d+)'


The result of the osascript is nnn-nnn-nnn (U.S.)

3 replies
Question marked as Top-ranking reply

Nov 7, 2025 3:37 AM in response to Zorba_le_grec

Notes can export as PDF or Markdown. That is it. Beneath what you see in Notes text is HTML markup.


Solutions:

  1. Copy the content in Notes to the clipboard. In the Terminal, use the pbpaste command to pipe that text (not html) to UNIX utilities. The mvim is a UNIX soft link to /Applications/MacVim.app/Contents/bin/mvim.
    1. pbpaste | vim -
    2. pbpaste | mvim -
  2. osascript
osascript -e 'tell application "Notes" to get plaintext of first note whose name contains "T-mobile"' | egrep -o '(\d+-\d+-\d+)'


The result of the osascript is nnn-nnn-nnn (U.S.)

How to export a note as plain text file?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.