Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello ā I'm @olemoritz on Twitter.
Create a new contact with a contact pic
-
thanks! that seems to work great for creating a new contact and retaining the image.
how do I add a phone number? heres what Iām trying unsuccessfully:
lv=ObjCClass('CNLabeledValue').alloc().init() lv.label='Main' lv.value='1113335555' mc.phoneNumbers=[lv]
thank you!
-
Update I figured it out, thanks!!
heres what worked:
pn=ObjCClass('CNPhoneNumber').alloc().init(stringValue='1231231234') lv=ObjCClass('CNLabeledValue').alloc().init(label=contacts.MAIN_PHONE, value=pn).autorelease() mc.phoneNumbers=[lv]
-
Do you really need ObjC to do these thing? Why not just use the contacts module?
-
@ccc I use objectivec for the image and if he uses contacts in the same script, he said in his first post that he had problems of one destroying the other one...
-
-
@average Believe me, I am very far from being a guru. I have a lot of free time to try and try again š
-
Why use ObjC for person.image_data?
https://forum.omz-software.com/topic/5448/contacts-images -
-
@ccc the worst is that I certainly read this topic, ha this old memory š¢š“š»
-
My recollection is that person.image_data was not present in the original version of the contacts module but was added later. That is why it is not in the webpage docs but is in the in-the-app docs. I also think the workaround code was published before person.image_data was added to the module.
With the current module, I believe that you can do it all without ObjC.