issue_comments
21 rows where author_association = "MEMBER" and "created_at" is on date 2023-03-09 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: issue_url, created_at (date), updated_at (date)
user 1
- simonw 21
id | html_url | issue_url | node_id | user | created_at | updated_at ▲ | author_association | body | reactions | issue | performed_via_github_app |
---|---|---|---|---|---|---|---|---|---|---|---|
1462968053 | https://github.com/dogsheep/apple-notes-to-sqlite/issues/11#issuecomment-1462968053 | https://api.github.com/repos/dogsheep/apple-notes-to-sqlite/issues/11 | IC_kwDOJHON9s5XMx71 | simonw 9599 | 2023-03-09T23:24:01Z | 2023-03-09T23:24:01Z | MEMBER | I improved the readability by removing some unnecessary table aliases:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Implement a SQL view to make it easier to query files in a nested folder 1618130434 | |
1462962682 | https://github.com/dogsheep/apple-notes-to-sqlite/issues/11#issuecomment-1462962682 | https://api.github.com/repos/dogsheep/apple-notes-to-sqlite/issues/11 | IC_kwDOJHON9s5XMwn6 | simonw 9599 | 2023-03-09T23:20:35Z | 2023-03-09T23:22:41Z | MEMBER | Here's a query that returns all notes in folder 1, including notes in descendant folders:
``` SQLite schema: CREATE TABLE [folders] ( [id] INTEGER PRIMARY KEY, [long_id] TEXT, [name] TEXT, [parent] INTEGER, FOREIGN KEY([parent]) REFERENCES folders ); Write a recursive CTE that returns the following: folder_id | descendant_folder_id With a row for every nested child of every folder - so the top level folder has lots of rows
Convert all SQL keywords to lower case, and re-indent ``` |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Implement a SQL view to make it easier to query files in a nested folder 1618130434 | |
1462965256 | https://github.com/dogsheep/apple-notes-to-sqlite/issues/11#issuecomment-1462965256 | https://api.github.com/repos/dogsheep/apple-notes-to-sqlite/issues/11 | IC_kwDOJHON9s5XMxQI | simonw 9599 | 2023-03-09T23:22:12Z | 2023-03-09T23:22:12Z | MEMBER | Here's what the CTE from that looks like: |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Implement a SQL view to make it easier to query files in a nested folder 1618130434 | |
1462693867 | https://github.com/dogsheep/apple-notes-to-sqlite/issues/7#issuecomment-1462693867 | https://api.github.com/repos/dogsheep/apple-notes-to-sqlite/issues/7 | IC_kwDOJHON9s5XLu_r | simonw 9599 | 2023-03-09T20:01:39Z | 2023-03-09T20:02:11Z | MEMBER | My
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Folder support 1617769847 | |
1462691466 | https://github.com/dogsheep/apple-notes-to-sqlite/issues/7#issuecomment-1462691466 | https://api.github.com/repos/dogsheep/apple-notes-to-sqlite/issues/7 | IC_kwDOJHON9s5XLuaK | simonw 9599 | 2023-03-09T19:59:52Z | 2023-03-09T19:59:52Z | MEMBER | Improved script:
ID: x-coredata://D2D50498-BBD1-4097-B122-D15ABD32BDEC/ICFolder/p698 Name: JSK Container: ID: x-coredata://D2D50498-BBD1-4097-B122-D15ABD32BDEC/ICFolder/p7995 Name: Nested inside blog posts Container: x-coredata://D2D50498-BBD1-4097-B122-D15ABD32BDEC/ICFolder/p6113 ID: x-coredata://D2D50498-BBD1-4097-B122-D15ABD32BDEC/ICFolder/p3526 Name: New Folder Container: ID: x-coredata://D2D50498-BBD1-4097-B122-D15ABD32BDEC/ICFolder/p3839 Name: New Folder 1 Container: ID: x-coredata://D2D50498-BBD1-4097-B122-D15ABD32BDEC/ICFolder/p2 Name: Notes Container: ID: x-coredata://D2D50498-BBD1-4097-B122-D15ABD32BDEC/ICFolder/p6059 Name: Quick Notes Container: ID: x-coredata://D2D50498-BBD1-4097-B122-D15ABD32BDEC/ICFolder/p7283
Name: UK Christmas 2022
Container:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Folder support 1617769847 | |
1462682795 | https://github.com/dogsheep/apple-notes-to-sqlite/issues/7#issuecomment-1462682795 | https://api.github.com/repos/dogsheep/apple-notes-to-sqlite/issues/7 | IC_kwDOJHON9s5XLsSr | simonw 9599 | 2023-03-09T19:52:20Z | 2023-03-09T19:52:44Z | MEMBER | Created through several rounds with ChatGPT (including hints like "rewrite that using setdefault()"): ```python def topological_sort(nodes): children = {} for node in nodes: parent_id = node["parent"] if parent_id is not None: children.setdefault(parent_id, []).append(node)
``` |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Folder support 1617769847 | |
1462570187 | https://github.com/dogsheep/apple-notes-to-sqlite/issues/7#issuecomment-1462570187 | https://api.github.com/repos/dogsheep/apple-notes-to-sqlite/issues/7 | IC_kwDOJHON9s5XLQzL | simonw 9599 | 2023-03-09T18:30:24Z | 2023-03-09T18:30:24Z | MEMBER | I used ChatGPT to write this:
Folder ID: x-coredata://D2D50498-BBD1-4097-B122-D15ABD32BDEC/ICFolder/p698 Folder Name: JSK Folder Container: iCloud Folder ID: x-coredata://D2D50498-BBD1-4097-B122-D15ABD32BDEC/ICFolder/p7995 Folder Name: Nested inside blog posts Folder Container: Blog posts Folder ID: x-coredata://D2D50498-BBD1-4097-B122-D15ABD32BDEC/ICFolder/p3526 Folder Name: New Folder Folder Container: iCloud Folder ID: x-coredata://D2D50498-BBD1-4097-B122-D15ABD32BDEC/ICFolder/p3839 Folder Name: New Folder 1 Folder Container: iCloud Folder ID: x-coredata://D2D50498-BBD1-4097-B122-D15ABD32BDEC/ICFolder/p2 Folder Name: Notes Folder Container: iCloud Folder ID: x-coredata://D2D50498-BBD1-4097-B122-D15ABD32BDEC/ICFolder/p6059 Folder Name: Quick Notes Folder Container: iCloud Folder ID: x-coredata://D2D50498-BBD1-4097-B122-D15ABD32BDEC/ICFolder/p7283 Folder Name: UK Christmas 2022 Folder Container: iCloud ``` So I think the correct approach here is to run code at the start to list all of the folders (no need to do fancy recursion though, just a flat list with the parent containers is enough) and create a model of that hierarchy in SQLite. Then when I import notes I can foreign key reference them back to their containing folder. I'm tempted to use |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Folder support 1617769847 | |
1462564717 | https://github.com/dogsheep/apple-notes-to-sqlite/issues/7#issuecomment-1462564717 | https://api.github.com/repos/dogsheep/apple-notes-to-sqlite/issues/7 | IC_kwDOJHON9s5XLPdt | simonw 9599 | 2023-03-09T18:25:39Z | 2023-03-09T18:25:39Z | MEMBER | So it looks like folders can be hierarchical? |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Folder support 1617769847 | |
1462562735 | https://github.com/dogsheep/apple-notes-to-sqlite/issues/7#issuecomment-1462562735 | https://api.github.com/repos/dogsheep/apple-notes-to-sqlite/issues/7 | IC_kwDOJHON9s5XLO-v | simonw 9599 | 2023-03-09T18:23:56Z | 2023-03-09T18:25:22Z | MEMBER | From the Script Editor library docs: A note has a:
Here's what a folder looks like:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Folder support 1617769847 | |
1462556829 | https://github.com/dogsheep/apple-notes-to-sqlite/issues/4#issuecomment-1462556829 | https://api.github.com/repos/dogsheep/apple-notes-to-sqlite/issues/4 | IC_kwDOJHON9s5XLNid | simonw 9599 | 2023-03-09T18:20:56Z | 2023-03-09T18:20:56Z | MEMBER | In terms of the UI: I'm tempted to say that the default behaviour is for it to run until it sees a note that it already knows about AND that has matching update/created dates, and then stop. You can do a full import again ignoring that logic with |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Support incremental updates 1616429236 | |
1462554175 | https://github.com/dogsheep/apple-notes-to-sqlite/issues/4#issuecomment-1462554175 | https://api.github.com/repos/dogsheep/apple-notes-to-sqlite/issues/4 | IC_kwDOJHON9s5XLM4_ | simonw 9599 | 2023-03-09T18:19:34Z | 2023-03-09T18:19:34Z | MEMBER | It looks like the iteration order is most-recently-modified-first - I tried editing a note a bit further back in my notes app and it was the first one output by |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Support incremental updates 1616429236 | |
1461285545 | https://github.com/dogsheep/apple-notes-to-sqlite/issues/2#issuecomment-1461285545 | https://api.github.com/repos/dogsheep/apple-notes-to-sqlite/issues/2 | IC_kwDOJHON9s5XGXKp | simonw 9599 | 2023-03-09T05:06:24Z | 2023-03-09T05:06:24Z | MEMBER | OK, this works! |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
First working version 1616354999 | |
1461262577 | https://github.com/dogsheep/apple-notes-to-sqlite/issues/2#issuecomment-1461262577 | https://api.github.com/repos/dogsheep/apple-notes-to-sqlite/issues/2 | IC_kwDOJHON9s5XGRjx | simonw 9599 | 2023-03-09T04:30:00Z | 2023-03-09T04:30:00Z | MEMBER | It doesn't have tests yet. I guess I'll need to mock |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
First working version 1616354999 | |
1461260978 | https://github.com/dogsheep/apple-notes-to-sqlite/issues/2#issuecomment-1461260978 | https://api.github.com/repos/dogsheep/apple-notes-to-sqlite/issues/2 | IC_kwDOJHON9s5XGRKy | simonw 9599 | 2023-03-09T04:27:18Z | 2023-03-09T04:27:18Z | MEMBER | Before that conversion:
After:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
First working version 1616354999 | |
1461259490 | https://github.com/dogsheep/apple-notes-to-sqlite/issues/2#issuecomment-1461259490 | https://api.github.com/repos/dogsheep/apple-notes-to-sqlite/issues/2 | IC_kwDOJHON9s5XGQzi | simonw 9599 | 2023-03-09T04:24:27Z | 2023-03-09T04:24:27Z | MEMBER | Converting AppleScript date strings to ISO format is hard! https://forum.latenightsw.com/t/formatting-dates/841 has a recipe I'll try:
Not clear to me how timezones work here. I'm going to ignore them for the moment. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
First working version 1616354999 | |
1461234591 | https://github.com/dogsheep/apple-notes-to-sqlite/issues/2#issuecomment-1461234591 | https://api.github.com/repos/dogsheep/apple-notes-to-sqlite/issues/2 | IC_kwDOJHON9s5XGKuf | simonw 9599 | 2023-03-09T03:56:45Z | 2023-03-09T03:56:45Z | MEMBER | My prototype showed that images embedded in notes come out in the HTML export as bas64 image URLs, which is neat. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
First working version 1616354999 | |
1461234311 | https://github.com/dogsheep/apple-notes-to-sqlite/issues/2#issuecomment-1461234311 | https://api.github.com/repos/dogsheep/apple-notes-to-sqlite/issues/2 | IC_kwDOJHON9s5XGKqH | simonw 9599 | 2023-03-09T03:56:24Z | 2023-03-09T03:56:24Z | MEMBER | I opened the "Script Editor" app on my computer, used Window -> Library to open the Library panel, then clicked on the Notes app there. I got this: So the notes object has these properties:
I'm going to ignore the concept of attachments for the moment. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
First working version 1616354999 | |
1461232709 | https://github.com/dogsheep/apple-notes-to-sqlite/issues/2#issuecomment-1461232709 | https://api.github.com/repos/dogsheep/apple-notes-to-sqlite/issues/2 | IC_kwDOJHON9s5XGKRF | simonw 9599 | 2023-03-09T03:54:28Z | 2023-03-09T03:54:28Z | MEMBER | I think the AppleScript I want to pass to |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
First working version 1616354999 | |
1461230436 | https://github.com/dogsheep/apple-notes-to-sqlite/issues/1#issuecomment-1461230436 | https://api.github.com/repos/dogsheep/apple-notes-to-sqlite/issues/1 | IC_kwDOJHON9s5XGJtk | simonw 9599 | 2023-03-09T03:51:52Z | 2023-03-09T03:51:52Z | MEMBER | This did the job! Next step is to turn that into a Python script. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Initial proof of concept with ChatGPT 1616347574 | |
1461230197 | https://github.com/dogsheep/apple-notes-to-sqlite/issues/1#issuecomment-1461230197 | https://api.github.com/repos/dogsheep/apple-notes-to-sqlite/issues/1 | IC_kwDOJHON9s5XGJp1 | simonw 9599 | 2023-03-09T03:51:36Z | 2023-03-09T03:51:36Z | MEMBER | After a few more rounds I got to this script, which outputs them to a ```zsh !/bin/zshosascript -e '
set notesFile to "/tmp/notes.txt"
set fileRef to open for access notesFile with write permission
tell application "Notes"
repeat with eachNote in every note
set noteId to the id of eachNote
set noteTitle to the name of eachNote
set noteBody to the body of eachNote
write "------------------------" & "\n" to fileRef
write noteId & "\n" to fileRef
write noteTitle & "\n\n" to fileRef
write noteBody & "\n" to fileRef
end repeat
end tell
close access fileRef'
cleaned_notes = [{ "id": n.split("\n")[0], "title": n.split("\n")[1], "body": "\n".join(n.split("\n")[2:]).strip() } for n in notes] db = sqlite_utils.Database("/tmp/notes.db") db["notes"].insert_all(cleaned_notes) ``` |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Initial proof of concept with ChatGPT 1616347574 | |
1461226402 | https://github.com/dogsheep/apple-notes-to-sqlite/issues/1#issuecomment-1461226402 | https://api.github.com/repos/dogsheep/apple-notes-to-sqlite/issues/1 | IC_kwDOJHON9s5XGIui | simonw 9599 | 2023-03-09T03:47:11Z | 2023-03-09T03:47:11Z | MEMBER | Me:
ChatGPT:
ChatGPT: ```zsh !/usr/bin/zshosascript -e 'tell application "Notes"
repeat with eachNote in every note
set noteTitle to the name of eachNote
set noteBody to the body of eachNote
set output to noteTitle & "\n" & noteBody & "\n"
display dialog output
log output
end repeat
end tell'
Me:
ChatGPT: ```zsh !/bin/zshosascript -e 'tell application "Notes" repeat with eachNote in every note set noteTitle to the name of eachNote set noteBody to the body of eachNote set output to noteTitle & "\n" & noteBody & "\n" log output end repeat end tell' ``` This really helps! |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Initial proof of concept with ChatGPT 1616347574 |
Advanced export
JSON shape: default, array, newline-delimited, object
CREATE TABLE [issue_comments] ( [html_url] TEXT, [issue_url] TEXT, [id] INTEGER PRIMARY KEY, [node_id] TEXT, [user] INTEGER REFERENCES [users]([id]), [created_at] TEXT, [updated_at] TEXT, [author_association] TEXT, [body] TEXT, [reactions] TEXT, [issue] INTEGER REFERENCES [issues]([id]) , [performed_via_github_app] TEXT); CREATE INDEX [idx_issue_comments_issue] ON [issue_comments] ([issue]); CREATE INDEX [idx_issue_comments_user] ON [issue_comments] ([user]);
issue 5