On Jun 19, 2011, at 21:11, Joshua Whalen wrote:
I need to find a person in my address book by the date their record was created. Is there a way to do this? They only entered their email address, and I don't recall their name, otherwise I wouldn't need to do this. There's over a thousand entries in the address book.
set dateRangeStart to date "Tuesday, September 14, 2010 00:00:00"
set dateRangeEnd to date "Wednesday, September 15, 2010 00:00:00"
set l to {}
tell application "Address Book"
try
name of people whose creation date > dateRangeStart and creation date < dateRangeEnd
on error errMsg number errNum
set sep to "=============================="
set e to sep & return & "Error: " & errMsg & return & sep & return ¬
& "Error Number: " & errNum & return & sep
beep
display dialog e
end try
end tell
# Note that 'date "1/1/2011"' will compile to:
date "Saturday, January 01, 2011 00:00:00"
# Although I believe the format depends upon your short date format in the 'Language & Text' prefs and your localization.