Apple Notes - hack? [message #1911] |
Tue, 04 March 2025 22:37  |
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   |
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   |
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   |
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   |
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 #1920 is a reply to message #1919] |
Sat, 15 March 2025 20:13  |
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.
|
|
|