I am using AppleScript to search through a bunch of my contacts, with a specific (custom) property.
Here is my code:
tell application "Address Book"
set allPeople to every person whose last name = "CERTAIN_LAST_NAME"
get properties of item 1 of allPeople
end tell
The specific last name is just a person who I knew had that specific property.
And the (trimmed) output:
CATEGORIES:Contacts
UID:{MY_EMAIL_ADDRESS}:426
X-ABUID:SOME_ID_TAG:ABPerson
END:VCARD
I want to find everyone who contains the property UID
with the value of {MY_EMAIL_ADDRESS}:some_number
. I'm very new to OS X and AppleScript to so I'm not really sure what to do. I searched for a way to filter my contacts based on a custom property, with:
tell application "Address Book"
set allPeople to every person whose UID = "{MY_EMAIL_ADDRESS}:426"
get properties of item 1 of allPeople
end tell
But this gave me this error:
my_script.scpt:69:72: execution error: The variable UID is not defined. (-2753)
I appreciate any help with this issue!