Re: problem with perform mail action with messages
Re: problem with perform mail action with messages
- Subject: Re: problem with perform mail action with messages
- From: Martin Michel <email@hidden>
- Date: Tue, 2 Feb 2010 08:22:39 +0100
Hi,
As far as I know you are not supposed to use user interaction in an Apple Mail rule script, e.g. display dialog/alert. In Mac OS X 10.5, using those elements would crash an Apple Mail script.
Best regards from Berlin,
Martin
Am 02.02.2010 um 06:23 schrieb airdrummer:
> mail.app rule fires, but i can't get it to save attachments: i get an apple event handler failed, err # -10000
>
> is that still a problem w/ snow leopard, or mail?
>
> using terms from application "Mail"
> on perform mail action with messages theMessages for rule theRule
> set thePath to POSIX path of (path to desktop) & "downloads/"
> tell application "Mail"
> repeat with thisMessage in theMessages
> try
> set cmd to (subject of thisMessage)
> set replyTo to (sender of thisMessage)
>
> set theAttachments to (every mail attachment of thisMessage)
> repeat with theAttachment in theAttachments
> set tvpiName to thePath & (name of theAttachment)
> display alert replyTo & " - " & cmd & ": " & tvpiName
> save theAttachment in thePath
> end repeat
> on error em
> display alert em
> end try
> end repeat
> end tell
> end perform mail action with messages
> end using terms from
> _______________________________________________
> 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
>
_______________________________________________
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