• 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: Error getting mail attachments
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error getting mail attachments


  • Subject: Re: Error getting mail attachments
  • From: Yvan KOENIG <email@hidden>
  • Date: Thu, 15 Dec 2016 11:21:50 +0100


Le 15 déc. 2016 à 10:34, S. J. Cunningham <email@hidden> a écrit :

On Dec 14, 2016, at 9:37 PM, David Crowe wrote:

I used to be able to get mail attachments and manipulate them, but now (El Capitan, Mail 9.3) I cannot. Here is a script that illustrates the problem:


tell application "Mail"
set theList to selection --> {message id 91500 of mailbox "INBOX" of account "IFAST" of application "Mail"}
repeat with aMessage in theList
return mail attachments of aMessage --> error "Mail got an error: AppleEvent handler failed." number -10000
end repeat
end tell


The first comment indicates that there is a single message selected in this case, so the repeat loop just executes once, and generates the error message shown in the second comment. Even if the mail message had no attachments (and it has several, in the example I was using), I don’t believe it would be correct.


Don't know if this is the problem here but I frequently run into problems with "lists" of one item because what is returned is not a list if there is only one item.  Particularly with the Finder.  I usually do a "if count of…" test to catch it.

Steve
------------------
OS X 10.6.8, AppleScript 2.1.2

Hello S. J.
You get that because you are running a very old version of the operating system !
Finder returns a list of one item for years.

Yvan KOENIG running Sierra 10.12.2 in French (VALLAURIS, France) jeudi 15 décembre 2016 11:20:28


 _______________________________________________
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: Error getting mail attachments
      • From: "S. J. Cunningham" <email@hidden>
References: 
 >Re: Error getting mail attachments (From: "S. J. Cunningham" <email@hidden>)

  • Prev by Date: Re: Error getting mail attachments
  • Next by Date: Re: Error getting mail attachments
  • Previous by thread: Re: Error getting mail attachments
  • Next by thread: Re: Error getting mail attachments
  • Index(es):
    • Date
    • Thread