hi,
the idea is to
1- select records from a database (FrontBase in my case) returning a list of persons (got that part)
2- check if name/firstname/organization combination exists
something like :
tell application "Address Book"
set listpersons to (every person whose last name is equal to cnaam and first name is equal to cfirstname and organization is equal to corganization)
if (count of listpersons) is 0 then
-- INSERT
set thisperson to (make new person with properties {first name:cfirstname, last name:clastname, organization:corganization, note:ccreationdate})
tell thisperson to make new email at end of emails with properties {label:clabel, value:cemailaddress}
else
-- if it exists, to update note with the date or even updating changed e-mail address ...
-- listpersons always 1 in the list in this case, always 1 office e-mail address
repeat with thisperson in listpersons
tell thisperson
set note to "Updated " & cmodificationdate -- how to update this property ?
set listphones to phones
repeat with thisphone in listphones
set value of thisphone to ctelephone
end repeat
end tell
end repeat
end if
end tell