Re: Address Book Question & Another address book question
Re: Address Book Question & Another address book question
- Subject: Re: Address Book Question & Another address book question
- From: Lachlan Deck <email@hidden>
- Date: Wed, 18 Feb 2004 12:39:44 +1100
Hi again,
a further example combining the two questions (Address Book Question &
Another address book question):
on getEveryEmailWithLabel(emailLabel)
tell application "Address Book"
set theResultList to {}
set theLabelList to label of every email of every person
set theValueList to value of every email of every person
-- list counts will be the same
repeat with i from 1 to count of theLabelList
set thisLabel to item i of theLabelList as string
set thisValue to item i of theValueList as string
if (thisLabel equals emailLabel and thisValue contains "@") then
set the end of theResultList to thisValue
end if
end repeat
return theResultList
end tell
end getEveryEmailWithLabel
Now, what I find annoying is that you can't do the following...
set personList to every person
set theLabel list to label of every email of personList -- empty list!!
... which means that you can't (without duplicate code) have two
methods such as
on getEveryEmailWithLabelForPeople(personList, emailLabel)
-- similar to above code
end
on getEveryEmailWithLabel(emailLabel)
tell app "Address Book"
return my getEveryEmailWithLabelForPeople(every person, emailLabel)
end
end
Surely this should make sense, but it doesn't work...
with regards,
--
Lachlan Deck
email@hidden
_______________________________________________
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.