contacts
contacts copied to clipboard
Query not finding all contacts
It looks like the script is only finding a subset of contacts. For example, if I have a contacts David
and Dad
, the command contacts da
is right now only returning a match for Dad
, and ignoring David
.
Probably right now around 50% of my contacts aren't finable with the script.
Ah, it looks like the culprit is
109 try store.enumerateContacts(with: fetchRequest) { contact, stop in
110 if contact.emailAddresses.count > 0 {
111 contacts.append(contact)
112 }
113 }
It seems like this an e-mail centric app (totally OK, it's your program) but maybe it's worth adding generalizability to searching all contacts by different fields (email, phone, etc?) No worries either way, I just modified this locally (to just append all matching contacts) and rebuilt.