• 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
Mail attachments
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Mail attachments


  • Subject: Mail attachments
  • From: Yvan KOENIG <email@hidden>
  • Date: Wed, 30 Dec 2015 16:28:47 +0100

Hello

I'm getting a puzzling behavior.

Most of the time, the code below - part of a large script - behaves flawlessly.

tell application "Mail"
activate
set theMessage to item 1 of (get selection)

get every mail attachment of theMessage
# code saving the attached files on disk

end tell

But, from time to time, and I don't understand why, although the first message selected has attachment(s), the instruction trying to get them fails with :
get every mail attachment of message id 52016 of mailbox "INBOX" of account "iCloud"
error "Erreur dans Mail : Le gestionnaire AppleEvent a échoué." number -10000

It's puzzling because I may drag and drop - by hand - the attached file on the desktop or in an other folder
Of course, I may enclose the instruction in a try  … end try block but in such case the script would fail to save the attachments.

At this time, I create a report file listing the messages behaving this odd way and save the attachments by hand but it's not satisfying.

The attachments for which I got this odd behavior are PDF and/or JPG files of around 300,000 bytes which is not a huge size.

I have no example of such behavior for messages received thru my .mac.com account but most of the messages received thru this one behave flawlessly.
Here is an example of normal result :
{mail attachment id "1.2" of message id 58836 of mailbox "INBOX" of account "iCloud" of application "Mail", mail attachment id "2" of message id 58836 of mailbox "INBOX" of account "iCloud" of application "Mail"}

Any idea ?

Yvan KOENIG running El Capitan 10.11.2 in French (VALLAURIS, France) mercredi 30 décembre 2015 16:27: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: Mail attachments
      • From: Christopher Stone <email@hidden>
    • Re: Mail attachments
      • From: Axel Luttgens <email@hidden>
  • Prev by Date: Setting the Subject Field in Mail
  • Next by Date: Re: Mail attachments
  • Previous by thread: Setting the Subject Field in Mail
  • Next by thread: Re: Mail attachments
  • Index(es):
    • Date
    • Thread