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

Extract name and email from Mail via AppleScript Apps
It seems a lot of Applescripters are not aware of this support offered by Mail.app. When writing Applescripts for Mail, it's extremely easy to fetch the name and e-mail address of a sender ...
using terms from application "Mail"
  on perform mail action with messages theSelectedMessages
    tell application "Mail"
      repeat with eachMessage in theSelectedMessages
        set theSender to extract name from sender of eachMessage
        display dialog "name:" & theSender
        set theAddress to extract address from sender of eachMessage
        display dialog "address:" & theAddress
      end repeat
    end tell
  end perform mail action with messages
end using terms from
That's all there is to it!
    •    
  • Currently 2.40 / 5
  You rated: 1 / 5 (5 votes cast)
 
[9,871 views]  

Extract name and email from Mail via AppleScript | 1 comments | Create New Account
Click here to return to the 'Extract name and email from Mail via AppleScript' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Extract name and email from Mail via AppleScript
Authored by: tamc on May 21, '04 07:22:27AM

I use this to announce my new mails. One thing that has been bugging me though, is if there is a way for a script to ask addressbook for the name of a person given the email? Anyone any clues for me? Thanks. Tom



[ Reply to This | # ]