Getting unexpected NSTaggedDate when pulling birthday properties from AddressBook?
Ramon Felciano <[email protected]> Sat, 13 Aug 2016 17:56:05 -0700
| Newsgroups | gmane.comp.python.pyobjc.devel |
|---|---|
| Message-ID | <CAGTJW3GykTAcEsr+k=mACiq7JmMsmzsDGLTh4i3Ewg4nhO=bhw@mail.gmail.com> |
Hello --
I am testing out pyobjc to perform some scripting on the Mac address book.
I'm trying to extend the provided exportBook.py script (
https://pythonhosted.org/pyobjc/examples/AddressBook/Scripts/exportBook/index.html)
to include several date fields such as birthdate. It looked to me like the
introspection model should allow me to simply add in additional field names:
FIELD_NAMES=(
('Last Name', AddressBook.kABLastNameProperty),
('First Name', AddressBook.kABFirstNameProperty),
('E-mail', AddressBook.kABEmailProperty),
('Birthday', AddressBook.kABBirthdayProperty),
)
However the encodeField function returns an attribute error:
-----------------
return value.encode('utf-8')
AttributeError: '__NSTaggedDate' object has no attribute 'encode'
-----------------
I'm not an Apple developer but some poking around on Google, StackExchange,
etc suggests that NSTaggedDate isn't typically a returned data type, and
the kABBirthdayProperty is supposed to be an NSDate property. This is
making me wonder if something when wrong with my pyobjc installation -- can
anyone suggest how best to debug this further?
Thanks in advance,
Ramon
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. http://sdm.link/zohodev2dev
_______________________________________________
Pyobjc-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyobjc-dev