Re: AB: Finding a contact from the phone number??
Re: AB: Finding a contact from the phone number??
- Subject: Re: AB: Finding a contact from the phone number??
- From: Jakob Peterhänsel <email@hidden>
- Date: Tue, 6 May 2003 10:27:36 +0200
Hi All.
Ok, I might have a error-prone Address Book DB, since this code returns
different results:
my findContactFromPhone("163806")
--> {}
my find_contact("163806")
--> {record with my card, containing the correct phone.}
on findContactFromPhone(searchNumber)
tell application "Address Book"
ignoring white space
get value of phone of people whose (value of some phone contains
searchNumber)
end ignoring
end tell
end findContactFromPhone
on find_contact(search_number)
tell application "Address Book"
repeat with myperson in people
repeat with myphone in phones of myperson
set phone_number to value of myphone as string
--set phone_number to (characters 2 thru (length of phone_number)
of phone_number) as string
ignoring white space
if phone_number contains search_number then
return {contact_info:myphone, person_info:myperson}
end if
end ignoring
end repeat
end repeat
end tell
end find_contact
So, now I'm puzzled! Is my AB database corrupt, or...
____________________________________________
Jakob Peterhdnsel
Technical Engineer
Tel: +45 7022 1014
Fax: +45 7022 1013
Mob: +45 40 16 38 06
email@hidden
www.NetPoint.com
[demime 0.98b removed an attachment of type image/tiff which had a name of image.tiff]
The information contained in this message is confidential or protected
by law.
If you are not the intended recipient, please contact the sender and
delete this message. Any unauthorised copying of this message or
unauthorised distribution of the information contained herein is
prohibited.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.