-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
show-lists
doesn't include custom 'smart lists'
#72
Comments
This seems to be a limitation of the Apple Reminders API itself not including Smart Lists. |
I haven't verified this, but ChatGPT seems to suggest that they may need to be manually implemented as filters: Full ChatGPT Response
|
After some investigation it seems that Tags themselves aren't exposed in the API for the EKReminders class. The ChatGPT example uses the very specific case of Today, Tomorrow and other Scheduled events to "tag" them by their due dates. Guess we'll just have to wait for Apple's Reminders API to catch up to the features |
@naafiyan When you say 'tags', what specifically are you referring to? Do you mean the specific 'hashtags' tags assigned to a reminder? Or are you referring to something else? The rules for smart lists can have many different aspects, not just tags, so even if they aren't currently accessible, the others may be:
That said, I also don't think there is a way to access the underlying rules that make up a smart list currently, so it would sort of be a manual process to implement these with various filters/etc (perhaps being able to create/save 'filter aliases' in this app would be useful for that?) |
It looks like the underlying sqlite database backing the Reminders app is stored at:
Within that I can see the tags information in the The The While I wouldn't personally risk writing to this DB for fear of corrupting it or similar; it might be possible to extract some relevant details from it in a 'read only' mode, that could then be used to filter the reminders returned from the official API's 'in app'. |
Following on from my above research, looking at the sqlite DB that contains the reminders data:
Based on that, it should be possible to get a list of all of the normal lists from the -- SELECT *
SELECT
Z_PK,
Z_ENT,
ZBADGEEMBLEM,
ZNAME2,
ZSORTINGSTYLE
FROM ZREMCDOBJECT
WHERE Z_ENT = '25' Which for my data, returns 9 entries:
⇒ sqlite3 -readonly -json /Users/devalias/Library/Reminders/Container_v1/Stores/Data-5070B790-D66D-40F7-8F4A-EC8E0FA88F3A.sqlite "
SELECT
Z_PK,
Z_ENT,
ZBADGEEMBLEM,
ZNAME2,
ZSORTINGSTYLE
FROM ZREMCDOBJECT
WHERE Z_ENT = '25'
"
[{"Z_PK":8,"Z_ENT":25,"ZBADGEEMBLEM":null,"ZNAME2":"Reminders","ZSORTINGSTYLE":"manual"},
{"Z_PK":2936,"Z_ENT":25,"ZBADGEEMBLEM":"{\"Emoji\" : \"💲\"}","ZNAME2":"To Buy","ZSORTINGSTYLE":"manual"},
{"Z_PK":2965,"Z_ENT":25,"ZBADGEEMBLEM":"{\"Emoji\" : \"🎓\"}","ZNAME2":"Learning","ZSORTINGSTYLE":"manual"},
{"Z_PK":2966,"Z_ENT":25,"ZBADGEEMBLEM":null,"ZNAME2":"Adulting","ZSORTINGSTYLE":"manual"},
{"Z_PK":2967,"Z_ENT":25,"ZBADGEEMBLEM":null,"ZNAME2":"Quality of Life","ZSORTINGSTYLE":"manual"},
{"Z_PK":3001,"Z_ENT":25,"ZBADGEEMBLEM":null,"ZNAME2":"People","ZSORTINGSTYLE":"manual"},
{"Z_PK":5060,"Z_ENT":25,"ZBADGEEMBLEM":"{\"Emoji\" : \"🛠️\"}","ZNAME2":"Projects","ZSORTINGSTYLE":"manual"},
{"Z_PK":7176,"Z_ENT":25,"ZBADGEEMBLEM":null,"ZNAME2":"Smart Lists","ZSORTINGSTYLE":"manual"},
{"Z_PK":9740,"Z_ENT":25,"ZBADGEEMBLEM":"{\"Emoji\" : \"☀️\"}","ZNAME2":"Daily","ZSORTINGSTYLE":"manual"}] And then I can access my smart lists as follows: -- SELECT *
SELECT
Z_PK,
Z_ENT,
ZBADGEEMBLEM1,
ZNAME3,
ZSORTINGSTYLE1,
ZSMARTLISTTYPE,
ZFILTERDATA
FROM ZREMCDOBJECT
WHERE Z_ENT = '30' Which for my data, returns 10 entries:
⇒ sqlite3 -readonly -json /Users/devalias/Library/Reminders/Container_v1/Stores/Data-5070B790-D66D-40F7-8F4A-EC8E0FA88F3A.sqlite "
SELECT
Z_PK,
Z_ENT,
ZBADGEEMBLEM1,
ZNAME3,
ZSORTINGSTYLE1,
ZSMARTLISTTYPE,
ZFILTERDATA
FROM ZREMCDOBJECT
WHERE Z_ENT = '30'
"
[{"Z_PK":18,"Z_ENT":30,"ZBADGEEMBLEM1":null,"ZNAME3":null,"ZSORTINGSTYLE1":"manual","ZSMARTLISTTYPE":"com.apple.reminders.smartlist.today","ZFILTERDATA":null},
{"Z_PK":2932,"Z_ENT":30,"ZBADGEEMBLEM1":"{\"Emoji\" : \"🏥\"}","ZNAME3":"Health","ZSORTINGSTYLE1":"manual","ZSMARTLISTTYPE":"com.apple.reminders.smartlist.custom","ZFILTERDATA":"{\"hashtags\":{\"hashtags\":[\"health\"]}}"},
{"Z_PK":3125,"Z_ENT":30,"ZBADGEEMBLEM1":"{\"Emoji\" : \"⏱\"}","ZNAME3":"This Week","ZSORTINGSTYLE1":null,"ZSMARTLISTTYPE":"com.apple.reminders.smartlist.custom","ZFILTERDATA":"{\"date\":{\"relativeRange\":[\"inNext\",\"1\",\"week\"]}}"},
{"Z_PK":4293,"Z_ENT":30,"ZBADGEEMBLEM1":"{\"Emoji\" : \"🎫\"}","ZNAME3":"Events","ZSORTINGSTYLE1":null,"ZSMARTLISTTYPE":"com.apple.reminders.smartlist.custom","ZFILTERDATA":"{\"hashtags\":{\"hashtags\":[\"event\"]}}"},
{"Z_PK":7157,"Z_ENT":30,"ZBADGEEMBLEM1":"{\"Emoji\" : \"📚\"}","ZNAME3":"To Read","ZSORTINGSTYLE1":"manual","ZSMARTLISTTYPE":"com.apple.reminders.smartlist.custom","ZFILTERDATA":"{\"hashtags\":{\"hashtags\":[\"to-read\"]}}"},
{"Z_PK":7177,"Z_ENT":30,"ZBADGEEMBLEM1":"{\"Emoji\" : \"🎥\"}","ZNAME3":"To Watch","ZSORTINGSTYLE1":null,"ZSMARTLISTTYPE":"com.apple.reminders.smartlist.custom","ZFILTERDATA":"{\"hashtags\":{\"hashtags\":{\"include\":[\"to-watch\",\"youtube-aitrepreneur\",\"youtube-crypto-crew-university\",\"youtube-daveshapiro\",\"youtube-mattvidpro\"],\"exclude\":[],\"operation\":\"or\"}},\"date\":{\"any\":\"\"},\"operation\":\"and\"}"},
{"Z_PK":14539,"Z_ENT":30,"ZBADGEEMBLEM1":"{\"Emoji\" : \"💾\"}","ZNAME3":"Backup","ZSORTINGSTYLE1":"manual","ZSMARTLISTTYPE":"com.apple.reminders.smartlist.custom","ZFILTERDATA":"{\"hashtags\":{\"hashtags\":[\"backup\"]}}"},
{"Z_PK":25188,"Z_ENT":30,"ZBADGEEMBLEM1":"{\"Emoji\" : \"🎥\"}","ZNAME3":"To Watch - Dave Shapiro","ZSORTINGSTYLE1":null,"ZSMARTLISTTYPE":"com.apple.reminders.smartlist.custom","ZFILTERDATA":"{\"hashtags\":{\"hashtags\":{\"exclude\":[],\"operation\":\"or\",\"include\":[\"youtube-daveshapiro\"]}},\"operation\":\"and\"}"},
{"Z_PK":25191,"Z_ENT":30,"ZBADGEEMBLEM1":null,"ZNAME3":null,"ZSORTINGSTYLE1":null,"ZSMARTLISTTYPE":"com.apple.reminders.smartlist.flagged","ZFILTERDATA":null},
{"Z_PK":25192,"Z_ENT":30,"ZBADGEEMBLEM1":null,"ZNAME3":null,"ZSORTINGSTYLE1":null,"ZSMARTLISTTYPE":"com.apple.reminders.smartlist.assigned","ZFILTERDATA":null}] Edit: Collated/cross-posted the above on the following gist for future reference: https://gist.github.com/0xdevalias/ccc2b083ff58b52aa701462f2cfb3cc8#accessing--exporting-apples-reminders-data-on-macos Edit 2: Found this cool blog post laying out a lot of the specifics of how the internals of Apple CoreData based SQLite databases are laid out: https://fatbobman.com/en/posts/tables_and_fields_of_coredata/ Edit 3: Based on that blog post, we can correlate the Edit 4: I wrote a basic python script to extract the CoreData models + hierarchy from the Reminders SQLite CoreData Models + Associated tables⇒ ./extract-coredata-model-hierarchy.py /Users/devalias/Library/Reminders/Container_v1/Stores/Data-5070B790-D66D-40F7-8F4A-EC8E0FA88F3A.sqlite
- 1: REMCDAccountListData (Table: ZREMCDACCOUNTLISTDATA)
- 2: REMCDChangeTrackingState (Table: ZREMCDCHANGETRACKINGSTATE)
- 3: REMCDHashtagLabel (Table: ZREMCDHASHTAGLABEL)
- 4: REMCDMigrationState (Table: ZREMCDMIGRATIONSTATE)
- 5: REMCDObject (Table: ZREMCDOBJECT)
- 6: REMCDAccount
- 7: REMCDAlarm
- 8: REMCDAlarmTrigger
- 9: REMCDAlarmDateTrigger
- 10: REMCDAlarmLocationTrigger
- 11: REMCDAlarmTimeIntervalTrigger
- 12: REMCDAlarmVehicleTrigger
- 13: REMCDAssignment
- 14: REMCDAttachment
- 15: REMCDFileAttachment
- 16: REMCDAudioAttachment
- 17: REMCDImageAttachment
- 18: REMCDURLAttachment
- 19: REMCDAuxiliaryChangeInfo
- 20: REMCDAuxiliaryReminderChangeInfo
- 21: REMCDAuxiliaryReminderChangeDeleteInfo
- 22: REMCDAuxiliaryReminderChangeMoveInfo
- 23: REMCDCalDAVNotification
- 24: REMCDHashtag
- 25: REMCDList
- 26: REMCDManualSortHint_v1
- 27: REMCDRecurrenceRule
- 28: REMCDSharedToMeReminderPlaceholder
- 29: REMCDSharee
- 30: REMCDSmartList
- 31: REMCDPublicTemplate (Table: ZREMCDPUBLICTEMPLATE)
- 32: REMCDReminder (Table: ZREMCDREMINDER)
- 33: REMCDReplicaManager (Table: ZREMCDREPLICAMANAGER)
- 34: REMCDSavedAttachment (Table: ZREMCDSAVEDATTACHMENT)
- 35: REMCDSavedReminder (Table: ZREMCDSAVEDREMINDER)
- 36: REMCDTemplate (Table: ZREMCDTEMPLATE)
- 37: REMCDTemplateOperationQueueItem (Table: ZREMCDTEMPLATEOPERATIONQUEUEITEM)
- 38: REMCKCloudState (Table: ZREMCKCLOUDSTATE)
- 39: REMCKServerChangeToken (Table: ZREMCKSERVERCHANGETOKEN)
- 40: REMCKSharedEntitySyncActivity (Table: ZREMCKSHAREDENTITYSYNCACTIVITY)
- 41: REMCKSharedObjectOwnerName (Table: ZREMCKSHAREDOBJECTOWNERNAME)
- 16001: CHANGE
- 16002: TRANSACTION
- 16003: TRANSACTIONSTRING |
From prior adventures in accessing the underlying sqlite db for apple apps (notes), it is, in my humble opinion, a huge headache. Much, much better off using standard API's that are stable, documented, and thus far less brittle. |
@cromulus When they exist; I'd agree with you 100%. But when they don't, or are limited and don't provide all of the things you'd like access to; that's what the above was exploring. |
Overview
When using the
show-lists
subcommand in reminders-cli, the output does not include custom 'smart lists' from macOS Reminders.Steps to Reproduce
reminders show-lists
.Expected Behavior
The
show-lists
subcommand should display all lists available in the macOS Reminders app, including 'smart lists'.Actual Behavior
The
show-lists
subcommand only displays regular lists and omits 'smart lists' from the output.Additional Information
Environment
The text was updated successfully, but these errors were encountered: