Re: speak text of email
Re: speak text of email
- Subject: Re: speak text of email
- From: Steve Bird <email@hidden>
- Date: Mon, 14 Jan 2013 11:47:55 -0500
On Jan 14, 2013, at 11:31 AM, dealTek wrote:
> Hi All,
>
> seems there is an issue with this script...
>
> In apple mail - I set a rule for any mail that contains "@" then run this applescript...
>
> Currently it is triggered from the rule but speaks what ever message is currently highlighted... but I want it to speak the ACTIVE INCOMING mail (not whatever is highlited)
>
> So I'll bet we have to do something like set theSelectedMessages to the === ACTIVE INCOMING mail ???
>
> Yo do we set that?
Here's what I use to announce mail from an important sender. I define an "important" sender by a rule which invokes this script:
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
set theSender to sender of theMessage
set theName to extract name from theSender
say "You have mail from " & theName as text
end if
end repeat
end tell
end perform_mail_action
This checks the read status. If it's been read already, it does NOT speak the name (when applying rules in other situations, for example).
----------------------------------------------------------------
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