contacts icon indicating copy to clipboard operation
contacts copied to clipboard

Query not finding all contacts

Open ds2606 opened this issue 2 years ago • 1 comments

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.

ds2606 avatar Apr 13 '22 16:04 ds2606

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.

ds2606 avatar Apr 13 '22 17:04 ds2606