Skip to content
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

Query not finding all contacts #17

Open
ds2606 opened this issue Apr 13, 2022 · 1 comment
Open

Query not finding all contacts #17

ds2606 opened this issue Apr 13, 2022 · 1 comment

Comments

@ds2606
Copy link

ds2606 commented Apr 13, 2022

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
Copy link
Author

ds2606 commented Apr 13, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant