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

Deletion of Contacts


  • Subject: Deletion of Contacts
  • From: debt <email@hidden>
  • Date: Thu, 08 Sep 2016 15:30:50 -0700

I’m trying to delete old records in Contacts.  I’ve created a custom date field called “created” which gets populated upon creation.  What I want is a script that goes through all the records in a particular group and deletes all records (not just from the group) that are over 30 days old.  Unfortunately, I can’t get it to work.  Here’s my latest attempt, without adding code for the group:


set the today to current date
tell application "Contacts"
repeat with the_person in people
set created to (custom date of the_person)
set diff to today - created
if diff > 2592000 then
delete the_person
end if
end repeat
end tell

The format of the custom date is m/d/y.  Is it a date format mismatch or do I have another problem?

Thanks,
Marc

OSX 10.11.6
 _______________________________________________
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

  • Follow-Ups:
    • Re: Deletion of Contacts
      • From: Andrew Oliver <email@hidden>
  • Prev by Date: Re: Milliseconds elapsed?
  • Next by Date: Re: Deletion of Contacts
  • Previous by thread: Re: Milliseconds elapsed?
  • Next by thread: Re: Deletion of Contacts
  • Index(es):
    • Date
    • Thread