Search address book

i’m trying to find out if a person already exists
if all 3 are not empty then the search works
but in some cases the firstname is a “missing value”

Q> how can one make this search to omit the missing value ones ?

the fields cname, cfirstname and corganization are obtained from a database query

tell application “Address Book” to set listpersons to (every person whose last name is equal to cname and first name is equal to cfirstname and organization is equal to corganization)

Do you mean you want to include first names with a missing value, geertlanduyt?

If so, you could try something like:

tell application "Address Book" to set listpersons to people whose (first name is cfirstname ¬
	or first name is missing value) and last name is cname and organization is corganization

hi,

When fetching from the database, sometimes the firstname is #NULL sometimes not.
To solve, it have put a . into firstname in case of a #NULL value (which equals missing value in Applescript)

geert