Skip to content

rileywiebe/apple-notes-exporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Apple Notes Exporter

A Ruby CLI tool to export Apple Notes to Markdown files.

Requirements

  • macOS (uses AppleScript to access Notes)
  • Ruby 3.0+
  • Bundler

Installation

bundle install

Usage

List Folders

bundle exec bin/apple-notes-exporter folders

Export Notes

Export all notes:

bundle exec bin/apple-notes-exporter export

Export from a specific folder:

bundle exec bin/apple-notes-exporter export --folder "Work"

Export with date filters:

bundle exec bin/apple-notes-exporter export --from 2024-01-01
bundle exec bin/apple-notes-exporter export --to 2024-12-31
bundle exec bin/apple-notes-exporter export --from 2024-01-01 --to 2024-06-30

Export to a custom directory:

bundle exec bin/apple-notes-exporter export --output ./my-notes

Combine all notes into a single file (ordered oldest to newest):

bundle exec bin/apple-notes-exporter export --combine
bundle exec bin/apple-notes-exporter export --combine --combine-filename "all_notes.md"

Options

Option Alias Description
--folder -f Filter by folder name
--from Filter notes created on or after this date (YYYY-MM-DD)
--to Filter notes created on or before this date (YYYY-MM-DD)
--output -o Output directory (default: ./export)
--combine -c Combine all notes into a single file
--combine-filename Filename for combined output (default: combined_notes.md)
--no-images Exclude images from exported markdown

Examples

Export work notes from Q1 2024:

bundle exec bin/apple-notes-exporter export \
  --folder "Work" \
  --from 2024-01-01 \
  --to 2024-03-31 \
  --output ./work-notes-q1

Create a combined archive of all personal notes:

bundle exec bin/apple-notes-exporter export \
  --folder "Personal" \
  --combine \
  --combine-filename "personal_archive.md"

Output Format

Individual notes are exported as Markdown files with:

  • Filename format: YYYYMMDD_Note_Title.md
  • Title as H1 heading
  • HTML content converted to Markdown

Combined output includes:

  • Notes separated by horizontal rules (---)
  • Creation date metadata at the end of each note
  • Notes ordered from oldest to newest

Permissions

On first run, macOS will prompt you to grant terminal access to Notes. Allow this to enable the export functionality.

Development

Running Tests

bundle exec rake test

Linting

bundle exec rubocop

License

MIT

About

Export Apple Notes to Markdown files.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages