Skip to content

activescott/apple-notes-export

Repository files navigation

apple-notes-export

code style: prettier License: MPL 2.0

A hack to free your notes from Apple Notes to markdown for use in TiddlyWiki, Boostnote, and more!

Usage

This is a hack at this point and I haven't published any of the packages to npm. I'm open to publishing them to make them easier to use if people are interested. Just submit a request here if you're interested.

Prerequisites

It must be run on macOS under the account/login that you want to access Apple Notes data from. You'll need a recent version of macOS and a recent node.js installed.

Building

First thing you'll need to do is build it. Just run /build.sh from the root.

Running & Exporting

To run the tool run the following from the root of the repo. Running without any arguments will print the help:

node ./packages/apple-notes-export-app/dist/cli.js

To export to markdown/tiddlywiki:

node ./packages/apple-notes-export-app/dist/cli.js tiddlywiki

NOTE: Tiddlywiki essentially stores files as markdown files (e.g. filename.md) with an adjacent .meta file (e.g. filename.md.meta). So if you want your Apple Notes exported to plain markdown files use TiddlyWiki. The above will export all notes, next go to the output directory that it exported to (by default to ~/Downloads/apple-notes-export/tiddlywiki/)

Opening in TiddlyWiki

To open and run TiddlyWiki to see your notes use the following steps:

cd ~/Downloads/apple-notes-export/tiddlywiki/

Create a folder for a new wiki that includes server-related components

npx tiddlywiki wiki --init server

Now copy the exported tiddlers into the new wiki dir:

mv ./tiddlers ./wiki/tiddlers

Start the tiddlywiki server:

npx tiddlywiki wiki --listen

Visit http://127.0.0.1:8080/ in your browser.

Click on the More tab on the right sidebar. Then select the All tab below it. You should see ALL of your notes!

Click on the More tab on the right sidebar. Then select the Tags tab below it. You should see tags for all of your folders from Apple Notes!

If you want to filter by a specific note use the --filter arg:

node ./packages/apple-notes-export-app/dist/cli.js tiddlywiki --filter "my note name"

For more options, run:

node ./packages/apple-notes-export-app/dist/cli.js --help

Exporting to Boostnote

NOTE: Boostenote support worked at one moment in time and I imagine it is still pretty close, but it definitely needs testing / work. I'd love contributions!

# export to boostnote:
node ./packages/apple-notes-export-app/dist/cli.js boostnote

Contributing

YOU are welcome to contribute! Please submit pull requests!

Developing

The big thing to note is that on the surface this looks like a normal Node.js/TypeScript project but it is not! It uses the osascript command-line tool (osascript is kinda like node.js but much more limited) to run the TypeScript (converted to JavaScript and bundled with Webpack) in Apple's "JavaScript for Automation" (JXA) which is part of the Open Scripting Architecture (OSA). It makes fairly extensive use of the Objective/C bridging to directly reference Objective/C SDK to make this all work.

Building

To build all the packages run /build.sh. There's no magic in there so it's a good reference to understand what's going on.

Packages / Repo Layout

For an overview of the packages see the README in the packages folder.

Notes on Developing with JavaScript for Automation

References

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •