Created
October 23, 2017 20:24
-
-
Save andrewmackenzie/70d17196f3373af4b9b22fd5b259efd1 to your computer and use it in GitHub Desktop.
Export Mail.app recent email addresses
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment