FoxTrot Search Forum
FoxTrot Search for macOS Forum

Home » Public Forums » FoxTrot Search User Forum » Apple Notes - hack?
Apple Notes - hack? [message #1911] Tue, 04 March 2025 22:37 Go to next message
mma165
Messages: 6
Registered: March 2025
Junior Member
I am a recent discoverer of FoxTrot for macOS after attempting to use pdfgrep and some other open source tools that did not work well. It's great to finally have a proper search tool.

I see from an older post that FoxTrot cannot give results from Apple Notes. I take it that the notes files are SQLite databases that could be indexed by FoxTrot but core services does not give access. Is there any way around this? For example, a scheduled script to place these files at an unprotected location for foxtrot indexing?
Re: Apple Notes - hack? [message #1912 is a reply to message #1911] Wed, 05 March 2025 09:09 Go to previous messageGo to next message
FoxTrot Engineering
Messages: 415
Registered: April 2020
Senior Member
Such an approach (a scheduled script or other sync mechanism that creates and updates individual files) is possible, but we won't implement it ourselves. However, we can make sure to support it if a third party does.

Jérôme - FoxTrot Engineering
Re: Apple Notes - hack? [message #1913 is a reply to message #1912] Wed, 05 March 2025 12:52 Go to previous messageGo to next message
Atlas
Messages: 149
Registered: August 2009
Senior Member
It's probably safer to routinely export Apple Notes and index those exports, than to mess around with the original SQLite database.  However, it's not easy to export lots of Apple Notes (thousands, for example).  This is the main reason why I've stopped using Apple Notes.  It's basically just a sink hole where my notes go to die, because it's hard to search and organize contents in Apple Notes.
Re: Apple Notes - hack? [message #1914 is a reply to message #1913] Fri, 14 March 2025 13:48 Go to previous messageGo to next message
mma165
Messages: 6
Registered: March 2025
Junior Member
It's quite easy to do: just use Docker and the code here:       https://github.com/threeplanetssoftware/apple_cloud_notes_pa rser?tab=readme-ov-file

In particular, for iCloud notes (which I think is a superset of all notes):
Navigate to `~/Library/Group Containers/group.com.apple.notes/`.
Look for the `NoteStore.sqlite` file and its associated files

Copy NoteStore.sqlite to some test directory.

Then, after installing Docker, you can do this:

docker run --rm \
 -v "$(pwd)":/data:ro \
 -v "$(pwd)"/output:/app/output \
 ghcr.io/threeplanetssoftware/apple_cloud_notes_parser \
 --file /[YOUR TEST DIRECTORY]/NoteStore.sqlite --one-output-folder --individual-files

Immediately after that, I created a separate index in FoxTrot just for this test directory. It had no problem indexing and then responding to queries of my apple Notes. With the '--individual-files' option each hit comes up as a separate html preview.

Trivial to create a script to do this on schedule using a plist and launchctl, using the actual NotesStore.sqlite location, or just using cron, at least on macOS.

-Malcolm

[Updated on: Fri, 14 March 2025 17:38]

Report message to a moderator

Re: Apple Notes - hack? [message #1916 is a reply to message #1914] Fri, 14 March 2025 19:45 Go to previous messageGo to next message
Atlas
Messages: 149
Registered: August 2009
Senior Member
Thanks for sharing the parser!  This is very useful, because notes with mixed formats (text with images and hyperlinks) are stored in different tables, so querying the sqlite database directly will give incomplete results.  You need a parser like this to piece the contents together, so that you can search complete notes.

Whoops ... look like it only work on Cloud Notes for iOS version 15 or earlier, so I'm out of luck.

[Updated on: Fri, 14 March 2025 19:50]

Report message to a moderator

Re: Apple Notes - hack? [message #1917 is a reply to message #1916] Fri, 14 March 2025 20:31 Go to previous messageGo to next message
mma165
Messages: 6
Registered: March 2025
Junior Member
I'm using it to process all my iCloud notes, spanning those created via iOS 18.3 and macOS 15.3 (Sequoia). No issues arose.
Re: Apple Notes - hack? [message #1919 is a reply to message #1917] Sat, 15 March 2025 17:16 Go to previous messageGo to next message
Atlas
Messages: 149
Registered: August 2009
Senior Member
Does it actually export your notes with images and handwriting as single html pages?
Re: Apple Notes - hack? [message #1920 is a reply to message #1919] Sat, 15 March 2025 20:13 Go to previous message
mma165
Messages: 6
Registered: March 2025
Junior Member
I just checked and the way I'm currently doing it no. It's not something I cared much about so I'm not sure if the tool chain I'm using could be adjusted or not.
Previous Topic: Gmail archive in 70GB mbox file; how to process for FT indexing?
Next Topic: Welcome to the FoxTrot Search User Forum
Goto Forum:
  


Current Time: Sat Mar 29 08:39:36 GMT+1 2025