Re: Running Scripts from Mail Rules
Re: Running Scripts from Mail Rules
- Subject: Re: Running Scripts from Mail Rules
- From: Steve Bird <email@hidden>
- Date: Fri, 27 Oct 2017 10:24:57 -0400
> On Oct 26, 2017, at 4:38 PM, Ray Robertson <email@hidden> wrote:
>
> I’m one upgrade above you (10.12.6, Mail 10.3). Curiously, your script works
> perfectly as is—as a Mail rule.
>
Ray now reports that this was in error - the script does indeed fail on his
system as well. So it’s unlikely that a new account would solve it.
Any other ideas as to why this line fails and terminates the script with no
error message?
using terms from application "Mail"
on perform mail action with messages (Msgs)
set N to count of Msgs
say "Messages: " & N
repeat with i from 1 to N
say ("Start " & i)
try
set M to item i of Msgs
say ("Got message")
set Nm to (sender of M) <——— FAIL !
say ("Got sender")
set S to (extract name from (sender of M) as
rich text)
say ("You have new mail from " & S)
on error
display dialog (errMsg as rich text)
end try
say ("end " & i)
end repeat
end perform mail action with messages
end using terms from
----------------------------------------------------------------
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
www.Culverson.com (toll free) 1-877-676-8175
_______________________________________________
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