Re: Applescipt in Mail rules
Re: Applescipt in Mail rules
- Subject: Re: Applescipt in Mail rules
- From: Steve Bird <email@hidden>
- Date: Fri, 31 Jan 2014 18:17:54 -0500
OK, apparently there are TWO separate problems.
1… You cannot MOVE a message from the SENT box with a rule.
2… Something is wrong (as of 10.9) with the script I was using.
The example you sent seems to work:
> using terms from application "Mail"
> on perform mail action with messages Msgs
> repeat with Msg in Msgs
> set Msg to contents of Msg
> tell application "Mail" to set SndrName to extract name from sender of Msg
> display dialog SndrName
> end repeat
> end perform mail action with messages
> end using terms from
Whereas my original worked fine on 10.4-10.6 but not 10.9:
> on perform_mail_action(theData)
> tell application "Mail"
> set theSelectedMessages to |SelectedMessages| of theData
> set theRule to |Rule| of theData
> repeat with a from 1 to count theSelectedMessages
> set theMessage to item a of theSelectedMessages
> if read status of theMessage then
> else --only speak for unread msgs
> set theSender to sender of theMessage
> set theName to extract name from theSender
> say "You have mail from " & theName as rich text
> end if
> end repeat
> end tell
> end perform_mail_action
No error, just no action. Even a BEEP() before the TELL is ignored.
----------------------------------------------------------------
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