Edit a contact iOS
Hello guys, it’s time for me to use this app (i bought it 2 years ago lol)
Now I’m trying to get one specific contact, i read the documentation and i could managed to get/retrieve the contact, but when i attempt to edit its phone value, it’s not saving it. Even with “contact.save()” at the end. Any help please? Thanks
import contacts import clipboard DEFAULT_CONTACT = 'Temporal' curr_cb = clipboard.get() people = contacts.get_all_people() for p in people: if p.first_name == DEFAULT_CONTACT: p.phone = [(contacts.MAIN_PHONE, int(curr_cb))] print(p.first_name + ' ' + p.phone) contacts.save() break print(p.phone) contacts.save() ```
Might be related?
Have you tried opening contacts to see if your update show up there? It may be that it just doesn't get updated within pythonista..
@3ryck that does not solve the problem (save does not work), but I think (perhaps erroneously) that
- telephone n° (curr_cb) is a string, not an int
- p.phone is a tuple, not an array of tuples (p.phone is an array)
p.phone = (p.phone,curr_cb)
This post is deleted!last edited by