[Pyobjc-dev] Getting unexpected NSTaggedDate when pulling birthday properties from AddressBook?
Brought to you by:
ronaldoussoren
From: Ramon F. <fel...@ya...> - 2016-08-14 00:56:14
|
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 |