Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

apple event handler fails

When I try to create a new mail message in Mail.app via AppleScript, the AppleEvent handler barfs. Here is a snippet which should work. It is taken from a script which once worked well, but now does not function. (I have no idea when the script stopped functioning, because I have had no need of it until today.)

*tell application "Mail"*
*make new outgoing message with properties {visible:true, subject:"test", content:"this is failing"}*
*end tell*

Does anyone have a clue why this is failing? The specific message is "Mail got an error: AppleEvent handler failed." I'm using Mail 3.5 under Mac OS X 10.5.5.

Bill

PowerBook G4, Mac OS X (10.5.5)

Posted on Sep 30, 2008 12:08 PM

Reply
Question marked as Best reply

Posted on Oct 3, 2008 12:02 PM

How many technicians does it take to change a light bulb?
"None, we have that same bulb here in our lab and it works fine."

Joking aside, sorry... tried your snippet and it works as would be expected. Time to start narrowing the source of the problem down; try it in another OS X account on the same computer, repair permissions, look at your logs, run all relevant software updates, temporarily move your ~/Library/Mail folder to eliminate it as a factor, etc.
Let us know what happens, especially if you get it working again. Best,
Joel
3 replies
Question marked as Best reply

Oct 3, 2008 12:02 PM in response to Bill Rising

How many technicians does it take to change a light bulb?
"None, we have that same bulb here in our lab and it works fine."

Joking aside, sorry... tried your snippet and it works as would be expected. Time to start narrowing the source of the problem down; try it in another OS X account on the same computer, repair permissions, look at your logs, run all relevant software updates, temporarily move your ~/Library/Mail folder to eliminate it as a factor, etc.
Let us know what happens, especially if you get it working again. Best,
Joel

Oct 5, 2008 6:59 AM in response to Joel D. Reid

I did get it working while trying to find the culprit. I have both MailTags and Mail Act-On from http://indev.com installed.

1. I tried the script on another, similarly set up machine---it failed.
2. I quit Mail.app.
3. I moved my MailTags Preferences, together with ~/Library/MailTags.mailbundle and ~/Library/MailTags Extras to a folder on the desktop.
4. I restarted Mail.app.
5. The script worked.
6. I quit Mail.app.
7. I put my MailTags Preferences and ~/Library/MailTags.mailbundle back where they belonged.
8. The script worked.
9. I quit Mail.app.
10. I put ~/Library/MailTags Extras back where it belonged.
11. The script worked. MailTags' behavior was also unchanged.

So... in the end, I now have just what I had before, but the script works fine. There must've been some sort of cruft in some cache which got cleared out when MailTags was not loaded once.

apple event handler fails

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.