• 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
Re: Apple Mail ToName Issue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Apple Mail ToName Issue


  • Subject: Re: Apple Mail ToName Issue
  • From: Michelle Steiner <email@hidden>
  • Date: Sat, 23 Oct 2010 12:04:29 -0700

On Oct 23, 2010, at 8:46 AM, DealTek wrote:

Yes, that's what it is supposed to say.

I found the problem; the code needs to be this:

if (theToName is {missing value})
set theToName to "TEST"
end if


I haven't analyzed the reason yet, but that's what works.

-- Michelle

Thanks a bunch Michelle!

Now that I've had the time, the reason is very obvious, and shows why my solution will not always work. There may be more than one "to:" addressees in a message.  Therefore, name of to recipient of eachMessage returns a list of the name of every "To:" addressee.  If there is only one "To:" addressee, the result is a list containing only one item.

If there are more than one "To:" addressees, my solution will fail.

You will need to decide how to handle the case with multiple "To:" addressees in your script.  If you're sure that the messages you will be handling have only one, there's no need to change anything, but you still might want to test for multiples just in case.

-- Michelle

--
Nobody ever procrastinated their way to the top.

 _______________________________________________
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: DealTek <email@hidden>
References: 
 >Apple Mail ToName Issue (From: DealTek <email@hidden>)
 >Re: Apple Mail ToName Issue (From: Michelle Steiner <email@hidden>)
 >Re: Apple Mail ToName Issue (From: DealTek <email@hidden>)
 >Re: Apple Mail ToName Issue (From: Michelle Steiner <email@hidden>)
 >Re: Apple Mail ToName Issue (From: DealTek <email@hidden>)

  • Prev by Date: Re: Apple Mail ToName Issue
  • Next by Date: Re: Still, script won't run on an older iMac.
  • Previous by thread: Re: Apple Mail ToName Issue
  • Next by thread: Re: Apple Mail ToName Issue
  • Index(es):
    • Date
    • Thread