• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Apple Mail ToName Issue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Apple Mail ToName Issue
      • From: Luther Fuller <email@hidden>
    • Re: Apple Mail ToName Issue
      • From: Michelle Steiner <email@hidden>
  • Prev by Date: Re: Feature request to solve a problematic AppleScript behavior with raw Apple Event codes
  • Next by Date: Re: Apple Mail ToName Issue
  • Previous by thread: Re: Quicktime Timecode track?
  • Next by thread: Re: Apple Mail ToName Issue
  • Index(es):
    • Date
    • Thread