Last active
October 24, 2015 23:42
-
-
Save rjames86/fbba26662c95a558e8af to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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