All, There appears to be a very reproducible error “-10000” “Apple Event Handler” regarding the access / use of Apple Mail email attachments by the OS X applescript terms “mail attachments” in OS X V10.10.1 yosemite. (2014/2015") .
I’d like to entertain any expertise on the matter. Please realise that the syntax (usage) is correct because the applications using the “mail attachments” facility have been in production for 7-8 years and are now inoperable in OS X 10.10.1
Any Apple Script or automator object that references “mail attachments” fails with OS return code “-10000” with error info as “Apple event Handler”.
For the sake of brevity and to focus on the precise issue, these EXAMPLE script snippets have ready access to Active Mail.app’s the current set of email(s) via OSASCRIPT, Applescript, Automator, Selection or other in var called “processing_email_messages” as :
tell application "Mail" to set processing_email_messages to
… any email or list
Example #1
tell application "Mail" to get count of mail attachments of first item in processing_email_messages
Example #2
if current_email's mail attachments is not {} then
Example #3
tell application "Mail" to get count of the mail attachments in (first item in processing_email_messages)
This has been reproduced on 6 independent / different 10.10.1 OS X systems and different users spaces (logons ~/)with the same error symptoms and therefore conclude that this issue is within the current OS X 10.10.1.
Symptom of any of these in any construct:
AppleScripts:
error “Mail got an error: AppleEvent handler failed.” number -10000
Automator: with nodes Get Selected Mail Messages ->> Get Attachments from Maill Messages
Get Attachments from Mail Messages Failed - Error 1
An error occurred while executing a script: The Operation couldn’t be completed. (OSStatus error -10000)
/var/syslog/system.log: these are very consistent.
Mail[49641]: *** Assertion failure in -[MCMimeBody dataForMimePart:], /SourceCache/Mail/Mail-1993/MailCore/MIME/MCMimeBody.m:362
Mail[49641]: An exception was thrown during execution of an NSScriptCommand…
Mail[49641]: This method must be called off the main thread
It appears form web searches that this is not unique to myself as many others have the precise issue that is UNRELATED to syntactic use of Applescript in OSx Mail.app.
I’d appreciate any help or comments on the matter or a workaround would be also very helpful.
Many Thanks
Warwick
Hong Kong
Model: OSX 10.10.1, email processor, automator, applescript
AppleScript: OSX 10.10.1 Yosemite
Browser: Safari 600.2.5
Operating System: Mac OS X (10.8)