Skip to content

Instantly share code, notes, and snippets.

View andrewmackenzie's full-sized avatar

Andrew MacKenzie andrewmackenzie

  • Capstan Networks, LLC
  • Downers Grove, IL
View GitHub Profile
@andrewmackenzie
andrewmackenzie / recent_email_addresses.sh
Created October 23, 2017 20:24
Export Mail.app recent email addresses
echo "display_name,email address,last_used" > ~/Desktop/recent_email_addresses.csv ; sqlite3 -csv ~/Library/Containers/com.apple.corerecents.recentsd/Data/Library/Recents/Recents "SELECT DISTINCT c.display_name, c.address, strftime('%m-%d-%Y', datetime(r.last_date/1000, 'unixepoch')) as_string FROM contacts c INNER JOIN recents r ON c.recent_id = r.ROWID WHERE c.kind = 'email' AND r.last_date > 1483921673792 ORDER BY r.last_date DESC;" | sort -f -u -t , -k 2,2 >> ~/Desktop/recent_email_addresses.csv