Apple Mail ToName Issue
Apple Mail ToName Issue
- Subject: Apple Mail ToName Issue
- From: DealTek <email@hidden>
- Date: Fri, 22 Oct 2010 14:27:14 -0700
Hi all,
Trying to grab the name and email of "to..."
If there is no name and just an email I'll get something like:
To: missing value <email@hidden>
-------------
i tried...
if (theToName is "") then ......(see below)
Q: but it didn't work - how do I set the name to "NoName" if there is none...?
------------------- code
tell application "Mail"
-- stuff
set theSelectedMessages to the selection
set eachMessage to item 1 of theSelectedMessages
set theSender to sender of eachMessage
set theToName to name of to recipient of eachMessage
set theToEmail to address of to recipient of eachMessage
set theAccountName to name of mailbox of eachMessage
-- stuff
if (theToName is "") then -- or I also tried if (theToName is "missing value")
set theToName to "TEST"
end if
end tell
set theText to "To: " & theToName & " <" & theToEmail & ">"
----------------------------- end code
--
Thanks,
Dave - DealTek
email@hidden
[db-10]
_______________________________________________
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