I am writing a script to export my addressbook contacts to a csv file. Depending on the contact, some of the data may be missing. I am then getting certain fields such as organization, in the csv file that appear as “missing value”.
How can I detect that an address book field is empty or not?
tell application "Address Book"
set person_ to properties of person 1
if organization of person_ is missing value then
set mv to true
-- deal with missing value
else
set mv to false
-- the value exists - include it in the export
end if
end tell
if mv is true then display dialog "no org"