by kello on 3/26/23, 4:59 PM with 105 comments
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!
by oneearedrabbit on 3/26/23, 7:28 PM
User::Account.server(database: "tmp/test.sqlite").first.
folders_dataset.offset(1).first
notes.
map(&:attachments).flatten.
find { |el| el.is_a?(User::ObjectTypes::EmbeddedPublicJpeg) &&
el.height > 700 &&
el.summary[/animal/i] }.
media_filepath
=> "Accounts/<uuid>/Media/F669B83A-0C47-408E-9645-015737F3B11F/Pasted Graphic.jpg"
Apple Notes' 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.I wish that one day, someone from the development team would write an article about it.
[0] https://devlog.notespub.com/2022/08/site-generator-for-apple...
by simonw on 3/26/23, 8:00 PM
I didn'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! https://til.simonwillison.net/gpt3/chatgpt-applescript
Apple Notes Liberator creates a copy of the SQLite database and then runs queries against that directly to extract the data.
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.
by ecliptik on 3/26/23, 11:25 PM
Mail.app/Reminders.app/Notes.app can use IMAP, Cal.app with CalDAV, and Contacts.app with CardDAV [1].
It doesn'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.
I've done this with my iPhone/Macs and Fastmail for the last few years and it works great [2].
1. https://support.apple.com/guide/iphone/set-up-mail-contacts-...
2. https://www.fastmail.help/hc/en-us/articles/1500000279941
by samwillis on 3/26/23, 6:57 PM
A particularly interesting thing that I don'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.
It looks like the info on the page may be a good place to start looking to how that works: https://www.ciofecaforensics.com/2020/10/20/apple-notes-clou...
by ChintanGhate on 3/26/23, 8:14 PM
Also, why did you select JSON as the output format?
by dangoor on 3/26/23, 7:25 PM
https://apps.apple.com/us/app/exporter/id1099120373?mt=12
(I haven't had a need yet, so I haven't tried it)
by css on 3/26/23, 6:39 PM
by mkmk on 3/26/23, 6:31 PM
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.
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.
by pjot on 3/26/23, 8:03 PM
I’ve been building an archiver tool as well to convert notes into markdown and post to git using Apple Shortcuts.
The interop between almost all iOS data formats (notes, safari, calendar, etc.) the content graph[0] provides is really impressive.
[0]: https://support.apple.com/en-me/guide/shortcuts/apd4618db957...
by vszakats on 3/26/23, 8:22 PM
https://gist.github.com/vszakats/5a3bd939721d1dde6142d9ea3b2...
And a short, standalone JXA script, that outputs HTML, but loses some data, such as links: https://gist.github.com/vszakats/f24e7700428c1e694e20cee0b1c...
by ericzawo on 3/27/23, 3:12 PM
I have dreamed of the ability to have a Notes web app with custom CSS for years and a few other features.
Good luck with this project I'll be watching closely
by dmd on 3/26/23, 9:04 PM
by divbzero on 3/26/23, 11:08 PM
IMAP syncing supports basic formatting (bold, italic, underline) but not all features supported by iCloud syncing (attachments, checklists, photos).
by rco8786 on 3/26/23, 8:27 PM
It works really well 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/MacBook.
by Alifatisk on 3/26/23, 7:23 PM
What’s next?
by munk-a on 3/26/23, 7:59 PM
by kepano on 3/26/23, 8:02 PM
Depending on what you are looking to achieve there are a few ways to export Apple Notes to Markdown files, but it's only a one-way out solution.
From the Obsidian forum: https://forum.obsidian.md/t/import-from-apple-notes-to-obsid...
by shanecleveland on 3/27/23, 11:00 PM
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 "diary."
by joe8756438 on 3/27/23, 11:55 AM
I think you can accomplish something close or the same? using shortcuts.
One obvious benefit is the interface is going to be more approachable than the jar to most people.
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.
by rhettbull on 3/28/23, 6:08 AM
by reaperducer on 3/26/23, 6:38 PM
But instead of pulling the data out of Notes, I took it from SMTP mail.
I don'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.
by podviaznikov on 3/26/23, 6:43 PM
I use the same amazing library linked in the blog post.
by akerr on 3/27/23, 5:18 AM
by solalf on 3/27/23, 3:41 AM
by mdmglr on 3/28/23, 3:53 AM
by jamesu on 3/26/23, 9:11 PM
by kolinko on 3/27/23, 12:13 PM
Where is it located usually? Or what's the file name?
by marcjensen on 3/27/23, 6:19 AM
by yosito on 3/27/23, 1:43 AM
by frozencell on 3/27/23, 9:44 PM
by egeozcan on 3/27/23, 5:54 AM
by gudh on 3/27/23, 7:45 AM