Is there an applescript that will extract any and all e-mail addresses in the bodies of e-mails in my inbox (mac mail)? I have a script that will extract the senders e-mail, but alot of the sender e-mail address are mailer-daemon etc…
I pretty much need to extract any group of words that have the @ symbol in body from all the mail in my inbox
AND/OR
Is there a way to take text1.txt and remove the list of e-mail addresses in that file from text2.txt?
Something like this, perhaps. Email addresses don’t have any spaces in them and contain “@”:
set tText to "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Proin eleifend ipsum eget nunc. Morbi mattis velit vel justo scelerisque ullamcorper. Nam tincidunt enim vel nisl. Aliquam nisl. Suspendisse george.jones@blandit.org, sapien at consectetuer faucibus, sem leo dignissim eros, at rhoncus lorem turpis in massa.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Proin eleifend ipsum eget nunc. Morbi mattis velit vel justo scelerisque ullamcorper. Nam calvin@aol.net tincidunt enim vel nisl. Aliquam nisl. Suspendisse blandit, sapien at consectetuer faucibus, sem leo dignissim eros, at rhoncus lorem turpis in massa."
set probables to {}
set tid to AppleScript's text item delimiters
set AppleScript's text item delimiters to space
set CW to text items of tText
set AppleScript's text item delimiters to tid
repeat with T in CW
if T contains "@" then set end of probables to contents of T
end repeat
--> {"george.jones@blandit.org,", "calvin@aol.net"}
Alright. I’m very new to applescript.
So I put this script into the editor and ran it but nothing happens.
What am I doing wrong?
Nothing - my fault. Add the word “probables” without the quotes at the bottom. To try it on some text of your own, copy the sample text and paste it in the line:
set tText to “paste it here”
Notice that it will also grab punctuation so if that’s a problem in you use, it can be eliminated dealt with.