Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Extract names and emails from a text file' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Extract names and emails from a text file
Authored by: gopes on Feb 23, '13 01:15:53PM
Not for nothing, but you can do this with AppleScript as well.
set theAddress to "Tim Cook "
tell the application "Mail" to extract address from theAddress -- returns "tim@apple.com"
tell the application "Mail" to extract name from theAddress -- returns "Tim Cook"
…Or on the command line:
osascript -e "tell the application \"Mail\" to extract address from \"Tim Cook <tim@apple.com>\""
That being said, I appreciate robg's original hint, as I use those command line tools from AppleScript as well, and it's always good to learn :)

[ Reply to This | # ]