Skip to content

Instantly share code, notes, and snippets.

@rjames86
Last active October 24, 2015 23:42
Show Gist options
  • Save rjames86/fbba26662c95a558e8af to your computer and use it in GitHub Desktop.
Save rjames86/fbba26662c95a558e8af to your computer and use it in GitHub Desktop.
ObjC.import("AddressBook");
meRecord = $.ABAddressBook.sharedAddressBook.me
function getNormalizedLabel(element){
return $.ABLocalizedPropertyOrLabel(element)
}
emails = meRecord.valueForProperty($.kABEmailProperty)
// returns the email labeled as Home in your Contacts.app record
for (var i = 0; i < emails.count; i++){
if ($.CFEqual(emails.labelAtIndex(i), $.kABHomeLabel)){
emails.valueAtIndex(i)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment