Re: Pull e-mail address from Mail.app
Re: Pull e-mail address from Mail.app
- Subject: Re: Pull e-mail address from Mail.app
- From: Luther Fuller <email@hidden>
- Date: Fri, 09 Mar 2012 14:37:18 -0600
Is there a way to extract the e-mail address from an account in Mail.app using the Description or perhaps the Full Name field? I want to set up an account and call it "AP", then to be able to pull the current address based on that description. Is this possible?
I see in Mail's dictionary that there is an "extract address from" command, but that seems to be for messages - not for accounts.
Try running this ...
tell application "Mail" set acntList to accounts as list repeat with anAcnt in acntList (email addresses of anAcnt) as Unicode text log the result end repeat end tell
tell application "Mail" set AppleScript's text item delimiters to {return} (email addresses of accounts) as Unicode text -- return delimited text set addressList to (text items of the result) -- list of text end tell
The first part gets the address of a particular account. The second part gets all addresses of all accounts.
Hope this does what you need. |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden