• 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: An Error in Mail
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: An Error in Mail


  • Subject: Re: An Error in Mail
  • From: Michelle Steiner <email@hidden>
  • Date: Tue, 27 Sep 2011 09:24:37 -0700

It appeared to me out of the blue that on Tue Sep 27 08:56:40 2011, Luther Fuller wrote these pearls of wisdom:

It seems that Mail does NOT return an empty list if there is no selection. Instead,
selected messages of frontViewer incorrectly returns NOTHING if there are no selected messages.

It doesn't return nothing; it returns "missing value".

So you could write the script this way:

tell application "Mail"
activate
set frontViewer to (some message viewer whose index is 1)
set msgList to (selected messages of frontViewer)
if msgList is not missing value then
set msgCount to (count items of msgList)
else
return
end if
end tell

By the way, if the front window is not a message viewer window, this line

set frontViewer to (some message viewer whose index is 1)

returns this error:

error "Mail got an error: Container specified was an empty list." number -1730

So you might want to trap for that too.

-- Michelle

-- 
If there's nothing that offends you in your community, then you know you're not living in a free society.
Kim Campbell - former Prime Minister of Canada

 _______________________________________________
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

References: 
 >An Error in Mail (From: Luther Fuller <email@hidden>)

  • Prev by Date: An Error in Mail
  • Next by Date: Telling if a Mac is equipped with a built-in iSight
  • Previous by thread: An Error in Mail
  • Next by thread: Telling if a Mac is equipped with a built-in iSight
  • Index(es):
    • Date
    • Thread