• 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: "a reference to"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "a reference to"


  • Subject: Re: "a reference to"
  • From: deivy petrescu <email@hidden>
  • Date: Sun, 6 Jan 2008 20:48:02 -0500


On Jan 6, 2008, at 20:08, Michelle Steiner wrote:

Even after writing scripts for nearly a decade and a half, I still haven't been able to wrap my brain around "a reference to". This script fails:

tell application "Address Book"
	set M_List_Group to people of group "Mailing Lists"
	set label of email 1 of every item of M_List_Group to "List"
	save addressbook
end tell

The error is:

"Can't get email 1 of {person id \"1FFAD12D-6EAA-11D7-94DF-000393D49636:ABPerson\" of application \"Address Book\", etc.

This works:

tell application "Address Book"
	set M_List_Group to a reference to people of group "Mailing Lists"
	set label of email 1 of M_List_Group to "List"
	save addressbook
end tell

What is the difference?

--
"Life is to cool to miss."
-- Sammy Camarata


I do not see a relationship with the error and "a reference to"

This does not work

set lista to {1, 2, 3, 4, 5}
set contents of every item of lista to "1"
--> error blah blah

The error above is telling you that AB can not get the email of a list.
I believe it to be a fair decision.
What your reference to is doing is just coercing the list to an AB format, that is "every person of group ..."
Now, you can ask AB to set the email 1 of every person to whatever


Deivy
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
References: 
 >"a reference to" (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: "a reference to"
  • Next by Date: Re: "a reference to"
  • Previous by thread: Re: "a reference to"
  • Next by thread: Re: "a reference to"
  • Index(es):
    • Date
    • Thread