• 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
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Address book


  • Subject: Re: Address book
  • From: Kevin Bradley <email@hidden>
  • Date: Sun, 29 Jul 2007 11:56:15 -0500

Peter,

You're dealing with an element, not a property, of the person's entry.  The short explanation is that properties always exist and elements may or may not exist.  If that entry hasn't got an email entry, it must be created with 

tell application "Address Book"
set thePeople to every person whose name is "David Baxter"
repeat with aperson in thePeople
tell aperson
make new email at end of emails with properties {label:"work", value:"email@hidden"}
end tell
end repeat
end tell

Hope this helps.

Kevin Bradley
email@hidden
http://macscripter.net

On Jul 29, 2007, at 2:29 AM, email@hidden wrote:

Message: 4

Date: Sun, 29 Jul 2007 11:10:13 +1000

From: Peter Baxter <email@hidden>

Subject: Address book

To: Apple Script <email@hidden>

Message-ID: <email@hidden">email@hidden>

Content-Type: text/plain; charset="iso-8859-1"


Hi people,


I was playing with the concept of an automatic updater of email  

addresses for mail to the address book based on Paul Tuckey's idea.   

Unfortunately this part of the script does not work:


tell application "Address Book"

try

set thePeople to (firstName & " " & lastName)

set first email of thePeople to theAddress

save addressbook

on error

set thePeople to (lastName & " " & firstName)

set first email of thePeople to theAddress

save addressbook

end try

end tell


   I get a class error


Can't set «class az21» 1 of "David Baxter" to  

"email@hidden".



Why?


Peter Baxter

email@hidden


 _______________________________________________
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

  • Prev by Date: Re: AppleScript and shell scripting
  • Next by Date: Re: AppleScript-Users Digest, Vol 4, Issue 354
  • Previous by thread: Re: Address book
  • Next by thread: GUI Scripting to toggle "Announce Time"?
  • Index(es):
    • Date
    • Thread