Hi Neville!
Last time I was writing basic programs in Turbopascal in 1996.
Maybe I'm doing something wrong...
1. I switched off in Mail "Use Smart Addresses".
2. I changed the path to my account in both commands:
Command A.
i=~/Library/Mail/muzaa@gmail.com@pop.gmail.com # Input file path
o=~/Desktop/ # Output file path
n=`date "+%y%m%d%H%M%S"`-"addresses" # time stamped file name
grep -rh From: $i | grep -o '[-a-zA-Z0-9.]*@.[^>]*' | awk '!seen[$0]++' > $o$n
Command B.
grep -rh From: ~/Library/Mail/muzaa@gmail.com@pop.gmail.com | grep -o '[-a-zA-Z0-9.]*@.[^>]*' | awk '!seen[$0]++' > ~/Desktop/`date \"+%y%m%d%H%M%S\"`"
3. I write commands in TERMINAL.
result of Command A:
List of couple emails same like before switching of "Use Smart Addresses"
I answered it already above:
It can extract to .txt file only email addresses from email header which includes after the name as well email address.
Example:
From: Neville Hillyer <n.hillyer@gmail.com>
If there is in header only the name without the email address then it's not extracted (email is visible after secondary click on the name)
Example:
From: Neville Hillyer
I just checked that most of emails I have has in the emailheader only the name without the email address so I miss most of email addresses.
Result of Command B:
>
And nothing going on...
4. I tried the same in AppleScript editor
Result of Command A:
Syntax error. A unknown token can’t go after this identifier.
I changed the path but I still get syntax errors
(instead of i=~/Library... i put i= Users/muzaa/Library...)
Result of Command B:
Syntax error: A “from” can’t go after this identifier.
grep -rh From: /Users/radimmuzikant/Library/Mail/POP-almeacz@gmail.com@pop.gmail.com | grep -o '[-a-zA-Z0-9.]*@.[^>]*' | awk '!seen[$0]++' > ~/Desktop/`date \"+%y%m%d%H%M%S\"`"