TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Apple Notes Liberator – Extract Notes.app Data and Save It as JSON

563 pointsby kelloabout 2 years ago
Hey there!<p>I just released the first version of a project I’ve been working on solves a very specific problem that perhaps only I have. I welcome any and all feedback, even if you just want to drop in to say that this is a hot piece of garbage!

32 comments

oneearedrabbitabout 2 years ago
I am excited to see more solutions that work with Apple Notes database directly. This is my go-to application to capture unstructured memos while researching various topics. Last year I got carried away and built a simple site generator for Notes [0]. As a fun exercise I implemented ORM models to query Sqlite database in Ruby:<p><pre><code> User::Account.server(database: &quot;tmp&#x2F;test.sqlite&quot;).first. folders_dataset.offset(1).first notes. map(&amp;:attachments).flatten. find { |el| el.is_a?(User::ObjectTypes::EmbeddedPublicJpeg) &amp;&amp; el.height &gt; 700 &amp;&amp; el.summary[&#x2F;animal&#x2F;i] }. media_filepath =&gt; &quot;Accounts&#x2F;&lt;uuid&gt;&#x2F;Media&#x2F;F669B83A-0C47-408E-9645-015737F3B11F&#x2F;Pasted Graphic.jpg&quot; </code></pre> Apple Notes&#x27; database structure is a fascinating product story. Notes started as a simple note-taking application that stored its content as raw HTML in a few simple tables. However, as the product grew and needed more features like collaboration, they had to make changes and add new columns and tables. They also implemented two flavors of CRDT-like algorithms that evolved over time: one for plaintext chunks and the other one for embedded objects like tables. On top of that, every change that Apple makes must be backward compatible to support legacy devices and systems; but backward-compatibility was not always possible and users had to go through “Migrate your Notes” steps, but it is again a product story.<p>I wish that one day, someone from the development team would write an article about it.<p>[0] <a href="https:&#x2F;&#x2F;devlog.notespub.com&#x2F;2022&#x2F;08&#x2F;site-generator-for-apple-notes&#x2F;" rel="nofollow">https:&#x2F;&#x2F;devlog.notespub.com&#x2F;2022&#x2F;08&#x2F;site-generator-for-apple...</a>
评论 #35320620 未加载
评论 #35324195 未加载
评论 #35320943 未加载
评论 #35320559 未加载
评论 #35335540 未加载
评论 #35319636 未加载
simonwabout 2 years ago
I wrote a similar tool in Python a few weeks ago, which uses AppleScript to liberate the data and saves it to a SQLite database: <a href="https:&#x2F;&#x2F;datasette.io&#x2F;tools&#x2F;apple-notes-to-sqlite" rel="nofollow">https:&#x2F;&#x2F;datasette.io&#x2F;tools&#x2F;apple-notes-to-sqlite</a><p>I didn&#x27;t actually know AppleScript before writing this tool... but it turned out ChatGPT knew it well enough to unblock me and provide me with exactly the code I needed to build the rest of the project! <a href="https:&#x2F;&#x2F;til.simonwillison.net&#x2F;gpt3&#x2F;chatgpt-applescript" rel="nofollow">https:&#x2F;&#x2F;til.simonwillison.net&#x2F;gpt3&#x2F;chatgpt-applescript</a><p>Apple Notes Liberator creates a copy of the SQLite database and then runs queries against that directly to extract the data.<p>I chose not to do that (despite being all-in on SQLite for everything) because I worry about future changes to the software baking my script - I figured the AppleScript interface was less likely to have breaking changes in the future.
评论 #35319618 未加载
评论 #35319880 未加载
评论 #35318992 未加载
评论 #35321362 未加载
评论 #35319630 未加载
评论 #35326636 未加载
评论 #35319553 未加载
ecliptikabout 2 years ago
A feature that a lot of Apple apps have that doesn&#x27;t seem talked about much is they can use standard protocols and not require iCloud.<p>Mail.app&#x2F;Reminders.app&#x2F;Notes.app can use IMAP, Cal.app with CalDAV, and Contacts.app with CardDAV [1].<p>It doesn&#x27;t offer a lot of the features iCloud has like advanced formatting or collaboration, but is a useful for simple standards based syncing and portability.<p>I&#x27;ve done this with my iPhone&#x2F;Macs and Fastmail for the last few years and it works great [2].<p>1. <a href="https:&#x2F;&#x2F;support.apple.com&#x2F;guide&#x2F;iphone&#x2F;set-up-mail-contacts-and-calendar-accounts-ipha0d932e96&#x2F;ios" rel="nofollow">https:&#x2F;&#x2F;support.apple.com&#x2F;guide&#x2F;iphone&#x2F;set-up-mail-contacts-...</a><p>2. <a href="https:&#x2F;&#x2F;www.fastmail.help&#x2F;hc&#x2F;en-us&#x2F;articles&#x2F;1500000279941" rel="nofollow">https:&#x2F;&#x2F;www.fastmail.help&#x2F;hc&#x2F;en-us&#x2F;articles&#x2F;1500000279941</a>
评论 #35321713 未加载
评论 #35324109 未加载
评论 #35324984 未加载
评论 #35323346 未加载
samwillisabout 2 years ago
Super interesting, particularly the link through to the blog with all the research into how Notes works.<p>A particularly interesting thing that I don&#x27;t see mentioned anywhere is that Apple Notes uses CRDTs (conflict free replicated data types) to enable both shared notes and multiple concurrent edits. With the CRDTs resolving the conflicts.<p>It looks like the info on the page may be a good place to start looking to how that works: <a href="https:&#x2F;&#x2F;www.ciofecaforensics.com&#x2F;2020&#x2F;10&#x2F;20&#x2F;apple-notes-cloudkit-data&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.ciofecaforensics.com&#x2F;2020&#x2F;10&#x2F;20&#x2F;apple-notes-clou...</a>
评论 #35318314 未加载
评论 #35326520 未加载
ChintanGhateabout 2 years ago
I have published an app [Exporter](<a href="https:&#x2F;&#x2F;apps.apple.com&#x2F;us&#x2F;app&#x2F;exporter&#x2F;id1099120373?mt=12" rel="nofollow">https:&#x2F;&#x2F;apps.apple.com&#x2F;us&#x2F;app&#x2F;exporter&#x2F;id1099120373?mt=12</a>) that does something similar - exports Apple Notes to HTML and markdown with the attachments. Give it a try, let me know if it solves your issue.<p>Also, why did you select JSON as the output format?
评论 #35319217 未加载
评论 #35323359 未加载
评论 #35322068 未加载
dangoorabout 2 years ago
Cool! Thanks for sharing. Also worth noting that there&#x27;s a Mac app in the app store to export to markdown or html:<p><a href="https:&#x2F;&#x2F;apps.apple.com&#x2F;us&#x2F;app&#x2F;exporter&#x2F;id1099120373?mt=12" rel="nofollow">https:&#x2F;&#x2F;apps.apple.com&#x2F;us&#x2F;app&#x2F;exporter&#x2F;id1099120373?mt=12</a><p>(I haven&#x27;t had a need yet, so I haven&#x27;t tried it)
评论 #35318761 未加载
cssabout 2 years ago
If anyone ever wanted to do something similar for iMessage data, I built a similar tool for that: <a href="https:&#x2F;&#x2F;github.com&#x2F;ReagentX&#x2F;imessage-exporter">https:&#x2F;&#x2F;github.com&#x2F;ReagentX&#x2F;imessage-exporter</a>
评论 #35320881 未加载
mkmkabout 2 years ago
I consistently struggle with Notes and iMessage sync issues, and I suspect it’s due to being a customer for so many years and making my way through many devices over those years.<p>The UX of the Apple ecosystem is so nice but when it goes sideways you’re kind of out of luck, even if you have applecare.<p>I wish they had some sort of premium “fix my esoteric appleID account issues” service you could pay them for once a decade or so.
评论 #35317955 未加载
评论 #35323064 未加载
pjotabout 2 years ago
This is great! How do you account for updates to a note?<p>I’ve been building an archiver tool as well to convert notes into markdown and post to git using Apple Shortcuts.<p>The interop between almost all iOS data formats (notes, safari, calendar, etc.) the content graph[0] provides is really impressive.<p>[0]: <a href="https:&#x2F;&#x2F;support.apple.com&#x2F;en-me&#x2F;guide&#x2F;shortcuts&#x2F;apd4618db957&#x2F;ios" rel="nofollow">https:&#x2F;&#x2F;support.apple.com&#x2F;en-me&#x2F;guide&#x2F;shortcuts&#x2F;apd4618db957...</a>
vszakatsabout 2 years ago
Here&#x27;s a Python script that takes the JSON output from <a href="https:&#x2F;&#x2F;github.com&#x2F;threeplanetssoftware&#x2F;apple_cloud_notes_parser">https:&#x2F;&#x2F;github.com&#x2F;threeplanetssoftware&#x2F;apple_cloud_notes_pa...</a> (needs master), and rebuilds Notes in Markdown format (or HTML), with links, attachments, lists, etc.:<p><a href="https:&#x2F;&#x2F;gist.github.com&#x2F;vszakats&#x2F;5a3bd939721d1dde6142d9ea3b2d1b5f" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;vszakats&#x2F;5a3bd939721d1dde6142d9ea3b2...</a><p>And a short, standalone JXA script, that outputs HTML, but loses some data, such as links: <a href="https:&#x2F;&#x2F;gist.github.com&#x2F;vszakats&#x2F;f24e7700428c1e694e20cee0b1cc542b" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;vszakats&#x2F;f24e7700428c1e694e20cee0b1c...</a>
ericzawoabout 2 years ago
Love this. I am an Apple Notes absolutist (see: <a href="https:&#x2F;&#x2F;pbs.twimg.com&#x2F;media&#x2F;FY1rZvNWIAAIRzs.jpg" rel="nofollow">https:&#x2F;&#x2F;pbs.twimg.com&#x2F;media&#x2F;FY1rZvNWIAAIRzs.jpg</a>). I have tried Evernote, Workflowy, Dynalist, Notion over the years for marrying personal &#x2F; professional worlds but always (always!!) come back to Notes.<p>I have dreamed of the ability to have a Notes web app with custom CSS for years and a few other features.<p>Good luck with this project I&#x27;ll be watching closely
评论 #35328683 未加载
评论 #35328003 未加载
评论 #35327752 未加载
dmdabout 2 years ago
I don&#x27;t understand what value this tool adds over the library it uses under the hood (which includes a command line tool for exporting your notes; I&#x27;ve been using it for years). What is it for?
评论 #35323322 未加载
divbzeroabout 2 years ago
Note that Notes.app can also sync with IMAP.<p>IMAP syncing supports basic formatting (bold, italic, underline) but not all features supported by iCloud syncing (attachments, checklists, photos).
rco8786about 2 years ago
Oh neat. I’ve been using Notes extensively since the beginning of this year. Daily journaling. Personal TODO lists, grocery list (shared w my wife), and gym&#x2F;workout tracking.<p>It works <i>really well</i> and has way more features than people realize. If you’re looking for like a “Notion-lite”, the answer might already be on your phone&#x2F;MacBook.
Alifatiskabout 2 years ago
So now we know how to export data from the notes.app, messages.app &amp; reminders.app.<p>What’s next?
评论 #35318826 未加载
munk-aabout 2 years ago
As a windows user, while we don&#x27;t have an OS built-in equivalent, the standard for such tools (in the form of Sublime and the like) is just to operate with temporary buffers that get written out as files on user request. Sublime will write internal data to some persistent storage somewhere and be able to survive sudden crashes and restarts but when you&#x27;d like to save the data out to a fixed filepath it&#x27;s pretty trivial to do so. I do find it quite weird that Apple has managed to cultivate a system where storage in separate files isn&#x27;t taken as the default.
kepanoabout 2 years ago
I am excited to see more ways to export data out of Apple Notes. Long term it would be amazing to see a solution that allows more interoperability with other apps.<p>Depending on what you are looking to achieve there are a few ways to export Apple Notes to Markdown files, but it&#x27;s only a one-way out solution.<p>From the Obsidian forum: <a href="https:&#x2F;&#x2F;forum.obsidian.md&#x2F;t&#x2F;import-from-apple-notes-to-obsidian&#x2F;732" rel="nofollow">https:&#x2F;&#x2F;forum.obsidian.md&#x2F;t&#x2F;import-from-apple-notes-to-obsid...</a>
shaneclevelandabout 2 years ago
I have been adopting Apple Notes more after trying to use a lot of other note methods&#x2F;apps. Always fall back to simple text in Notes. And I seem to be hearing of more people doing the same.<p>I recently set up a shortcut that works on both my Mac and iPhone to create a new note each day with the date as the title. And then each time I trigger the shortcut that day, it enters the time, location and weather. Easy way to keep a running &quot;diary.&quot;
joe8756438about 2 years ago
This is cool. I wanted to provide notes export for people using a note taking service I built and landed on a ios shortcut.<p>I think you can accomplish something close or the same? using shortcuts.<p>One obvious benefit is the interface is going to be more approachable than the jar to most people.<p>Shortcuts are also cool because you can build one and package it for others and even define user specific parameters that get filled on install.
rhettbullabout 2 years ago
Very nice reverse engineering work! I wrote a python library and CLI that does something similar but interacts with Notes via Scripting Bridge: <a href="https:&#x2F;&#x2F;github.com&#x2F;RhetTbull&#x2F;macnotesapp">https:&#x2F;&#x2F;github.com&#x2F;RhetTbull&#x2F;macnotesapp</a>
reaperducerabout 2 years ago
I built something similar a while back.<p>But instead of pulling the data out of Notes, I took it from SMTP mail.<p>I don&#x27;t know if it still works this way, but when I did it, if you used a non-iCloud email address to sync Notes, it saved the data as pain text in email messages that could be easily parsed.
评论 #35323333 未加载
podviaznikovabout 2 years ago
instead of extracting notes data as JSON my simple tool allows you to liberate your notes by publishing them to the web.<p><a href="https:&#x2F;&#x2F;montaigne.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;montaigne.io&#x2F;</a><p>I use the same amazing library linked in the blog post.
评论 #35323336 未加载
akerrabout 2 years ago
Why not just use the built-in Shortcuts to export to your preferred format?
评论 #35323319 未加载
solalfabout 2 years ago
Awesome initiative! I wish Apple Notes would support Markdown. This is my go to app for so much of my life, à Notion style editor would be an absolute game changer.
评论 #35336436 未加载
mdmglrabout 2 years ago
&quot;Liberator&quot; implies it was locked down. But notes content has always been easily accessible with AppleScript.
jamesuabout 2 years ago
For a long while I just copied everything to an imap server and dumped the mailbox, but this looks like an even better solution.
kolinkoabout 2 years ago
Nice! It throws an error that it cannot find the notes folder though.<p>Where is it located usually? Or what&#x27;s the file name?
评论 #35331853 未加载
marcjensenabout 2 years ago
Thanks for creating this. I must say that I don&#x27;t find things written in Java on HN very often.
yositoabout 2 years ago
It would be really cool to set this up to automatically sync notes to Obsidian.
frozencellabout 2 years ago
This but for the Mac Library now please (the format transfer are a mess)
egeozcanabout 2 years ago
I wish someone did this for Whatsapp without having to jailbreak my phone.
gudhabout 2 years ago
I wish there&#x27;s tool to extract Apple Books&#x27; notes too
评论 #35324034 未加载