tell application "Address Book" --ready to create a new Address Book record set ABpersref to (make new person with properties ¬ {first name:ABfname, middle name:ABmname, last name:ABlname, job title:ABtitle, department:ABdept, organization:ABco, note:ABnote, company:false}) tell person ABpersref make new address with properties {label:"Work Address", city:ABwkcity, country:ABwkctry, state:ABwkstate, street:ABwkadr, zip:ABwkzip} make new address with properties {label:"Home Address", city:ABhmcity, country:ABhmctry, state:ABhmstate, street:ABhmadr, zip:ABhmzip} make new phone with properties {label:"Work", value:ABwkphone} make new phone with properties {label:"Home", value:ABhmphone} make new phone with properties {label:"Fax", value:ABfaxphone}
if length of name = 0 then set company to true --"company" is a boolean; we'll set true if composite name is empty end tell --person ABpersref
end tell --Address Book
When run, it highlights the first "make new address" statement with this error message: Address Book got an error: Can't make person (person id "2F7657BA-AFDC-4A0F-AE0F-083FF023C1FF:ABPerson") into type reference. |