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 19:21:53 +0200
Hi...
On tirsdag, maj 6, 2003, at 15:42 Europe/Copenhagen, Paul Berkowitz
wrote:
>
As Michelle pointed out already, 'some phone' means 'random phone' - it
>
could be any phone number at all from the list of phone numbers for
>
each
>
person. I'm not even sure that a 'whose' clause is meant to work with
>
'some'
>
anything, since 'some' is not an application property but an
>
AppleScript
>
term. If it _did_ work, you should expect to get a different result
>
every
>
time since it means 'random'.
Well, I DO get the same result every time, but I'm missing a LOT of
records, if the query is simple, like:
tell application "Address Book"
get first name of every person whose value of some phone contains "+45"
{"Peter", "Morten", "Per", "Jan", missing value, "Martin", "Niels",
"Anette"}
end tell
Considering my 525 persons, (316 with 1 or more phone numbers) and 620
phone numbers, that does not seem very 'random' to me, nor does it tell
me that this function is working at all!
>
whereas I _would_ expect this to work:
>
>
get value of phone of people whose value of every home phone
>
contains
>
{searchNumber}
Well, it wont, since 'home' is not a constant, but a Unicode Text value
of Label
>
You can't just use your own notion of what 'some phone' means to you in
>
English and expect it to work in AppleScript. Its meaning is defined
>
in the
>
ASLG and it corresponds to just one specific meaning of 'some' in
>
English,
>
namely 'a random item from the list of every items'.
Well, I'm not trying to merge my own translation into AS, but this
seemed like to only way to specify that 'if one of the items in phone
contains' the value we are looking for. The contrast would be to use
'one', 'first', 'last' and 'every', but that is not what we are looking
for, now is it?
>
This time, there's nothing wrong with Address Book, but with your code.
Ahh, my code may be wrong, but I think AB is also wrong.
>
To get what you're looking for, you need the repeat loop in the second
>
example.
Sorry, it just takes WAY to long! Two loops, running through 500+
contacts with 600+ phones, takes way to long, we are talking 5+ seconds
here, where the direct query way takes ticks, although it currently
seems broken...
____________________________________________
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.