3

I'd like to view my contacts in order of last added in order to remember a few people who's names I now forget but meet this year when busy. The standard Select All… Copy… Paste into numbers as provided here doesn't have fields for record creation date and record edit date.

Wondering if an Applescript or other tool on macOS would make it possible to get this data along with contact data?

  • 1
    By default and just an example, the Contacts.app holds its data in a SQLite format 3 database named e.g. "AddressBook-v22.abcddb", located at "~/Library/Application Support/AddressBook/". I've opened a copy of this renamed with just a ".db" ext. in Liya and there are fields like ZCREATIONDATEYEAR and ZCREATIONDATEYEARLESS in the ZABCDRECORD records that can be examined to ascertain the info you're looking for. I'd imaging an SQL query could be formed to order the info most conducive to what you're looking of but I'd be of no help there. – user3439894 Mar 4 '17 at 23:30
1

You can use AppleScript to get the creation date and modification date of any contact in the Contacts app. Here is an example script that works on the entire Contacts file. At the end, you have a tab-delimited result called "the_text" which you can copy and paste into Numbers or Excel or whatever.

set the_text to ""
--
tell application "Contacts"
    set the_contacts to every person
    repeat with a_contact in the_contacts
        tell a_contact
            set the_name to name
            set long_creation_date to creation date
            set creation_date to short date string of long_creation_date
            set long_modification_date to modification date
            set modification_date to short date string of long_modification_date
            set the_text to the_text & return & the_name & tab & creation_date & tab & modification_date
        end tell
    end repeat
end tell

return the_text

The creation date of a contact is the full date, with time. So is the modification date. They look like this:

"Thursday, July 6, 2017 at 2:11:34 PM"

By asking for the "short date string" of those dates we get dates that look like this:

"7/6/17"

That format may be more useful for you for sorting purposes than the full long date with time.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .