Show HN: Apple Notes Liberator – Extract Notes.app Data and Save It as JSON (opens in a new tab)github.com
563 pointsHey there!
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!
Comments (105) 32 threads
Show all comments
Showing thread 2 of 32
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.
> I've been stubbornly refusing to learn AppleScript for nearly twenty years at this point. Thanks to ChatGPT I can continue not to learn it, but I can now use it to solve problems
The Apple scripting stuff can also use JavaScript. It might be better to continue not to learn in JavaScript instead of AppleScript, if ChatGPT is as adept at Apple scripting in JavaScript as it seems to be in AppleScript.
That way if you want to tweak what ChatGPT gives you it will probably be easier. With AppleScript both interacting with other things and control flow or computation can be weird and confusing. With JavaScript at least the control flow and computation will likely be more normal.
Added a section about this to my TIL: https://til.simonwillison.net/gpt3/chatgpt-applescript#user-...
The problem I always had with AppleScript is that it wasn't clear when I was writing AppleScript and when I was talking to an application's OSA dictionary (its "terminology" as Apple calls it in OSA).
Once I switched to Appscript (https://appscript.sourceforge.io/), that confusion went away. Of course I haven't used that in years since it's no longer supported and today I'd use JavaScript.
The issue though is that each application's terminology is isn't really documented. You can usually figure it out using Script Editor, but not always.
Some of this is documented here:
https://developer.apple.com/library/archive/documentation/La...
https://gist.github.com/mcint/561f72e6baa3e5c68c2577b04dad78...
I've linked some of my scripts, bash calling applescript, that I use extensively to export tabs from browsers.
Recently I wanted to have something like that but for Safari Reading list. The main difference is I tried to find a solution not for one time liberation, but for continuous 2-way exchange with some web service. It appears you HAVE to run everything locally for that. I like "privacy", but I like having options even more.
By the way it was ChatGPT that helped me to remove this several month old item from my TODO list.
It is also based on Action Script commands. I haven't played with it much yet, but it's on my TODO list (to add automatic headings for every day + archive DONE tasks automatically).