• 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: Delete person in AddressBook
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Delete person in AddressBook


  • Subject: Re: Delete person in AddressBook
  • From: Michelle Steiner <email@hidden>
  • Date: Thu, 6 Nov 2008 18:30:50 -0700

On Nov 6, 2008, at 4:24 PM, Robert R. Horning wrote:

In the error handler, I wish to tell Address Book to delete ThePerson so that I can start over, but have found no syntax that works.  Any ideas?

This works for me:

tell application "Address Book"
set testPerson to make new person with properties {first name:"test", last name:"test"}
save addressbook
tell testPerson
try
set its namenick to "foo"
on error
delete testPerson
save addressbook
end try
end tell
end tell

There is no property "namenick", so the try fails, and falls into the on error handler.

-- Michelle

--
Tubal Litigation: Suing because of a misconception

 _______________________________________________
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: 
 >Delete person in AddressBook (From: "Robert R. Horning" <email@hidden>)

  • Prev by Date: Delete person in AddressBook
  • Next by Date: accessing a property of an object in AppleScript
  • Previous by thread: Delete person in AddressBook
  • Next by thread: accessing a property of an object in AppleScript
  • Index(es):
    • Date
    • Thread