• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Address Book Question & Another address book question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: Address Book Question (From: Lachlan Deck <email@hidden>)

  • Prev by Date: Re: Launching TextEdit with a TEXT document
  • Next by Date: TextEdit and Unicode
  • Previous by thread: Re: Address Book Question
  • Next by thread: Another address book question
  • Index(es):
    • Date
    • Thread