Re: Address Book: why doesn't this work?
Re: Address Book: why doesn't this work?
- Subject: Re: Address Book: why doesn't this work?
- From: Matthew Smith <email@hidden>
- Date: Fri, 20 Jan 2006 12:41:49 +1100
- Thread-topic: Address Book: why doesn't this work?
Title: Re: Address Book: why doesn't this work?
on 20/01/2006 12:25, Rob Lewis at email@hidden wrote:
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.
Change:
tell person ABpersref
To
tell ABpersref
--
Matthew Smith
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden