Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'announce messaes with speech' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
announce messaes with speech
Authored by: cyberRodent on Jan 16, '03 06:40:18PM
I've been thinking about setting something to read the FROM of incoming messages and pass it along the this cl speech utility called "say" that give CL control over the built in speech synthesis. I think that with this I can have my Mac finally tell me when I get messages from ceratain folk -- this would be much preferred to setting up procmail and fetchmail to handle all my mail and piping what I want to this CL app . last I heard say is available from : http://www.umlautllama.com -- if it works out I'll post a solution. --- cyberRodent

[ Reply to This | # ]
announce messaes with speech
Authored by: russh on Jan 16, '03 07:02:31PM
You can do that with a modified version of the Applescript I posted: Create a mail rule that screens for a specific sender. "joeblow@nowhere.com" Then as the last action in the rule, attach a compiled Applescript like this:
on perform_mail_action(info)
	tell application "Mail"
		set selectedMessages to |SelectedMessages| of info
		set theRule to |Rule| of info
		repeat with eachMessage in selectedMessages
			set theSender to sender of eachMessage
			set theRuleName to name of theRule
			set theText to "You have a new message from" & theSender
			say theText
		end repeat
	end tell
end perform_mail_action
I just tested the above. It works. When a message comes in that triggers the rule (in this example, from "Joe Blow"), your Mac will say: "You have a new message from Joe Blow " The script will add the name of any sender you set up a rule for. There is likely a way to make it not say the email address. That exercise is left to the reader. :)

[ Reply to This | # ]
announce messaes with speech
Authored by: russh on Jan 16, '03 07:10:52PM
Hate to reply to my own message, but not sure how to edit. I just wanted to be clear: this script does NOT use "Say" or any other CLI application. The "say" in the script part of standard Applescript. No piping or terminal commands required. :) (Not that there is anything wrong with that...)

I just wanted to be clear.. it really is that simple.

[ Reply to This | # ]
How 'bout this one?
Authored by: applepal on Jan 16, '03 08:12:11PM

it's the first i ever wrote (with the first ost as example, thx)... this one works for me...

on perform_mail_action(info)
set volume 4
tell application "Mail"
set selectedMessages to |SelectedMessages| of info
set theRule to |Rule| of info
set amountofselectedMessages to count selectedMessages
if amountofselectedMessages > 1 then
set begintxt to "you have " & amountofselectedMessages & " new messages. [[emph -; rate 100]]from, "
else
set begintxt to "you have a message from "
end if
set counter to 0
repeat with eachMessage in selectedMessages
set counter to counter + 1
set theSender to sender of eachMessage
if counter > 1 then
set begintxt to "[[emph +; rate 200]]and from, "
end if
set theText to begintxt & theSender & " "
set adresbegin to offset of " 0 then
set theText to get text 1 thru adresbegin of theText
end if
say theText
end repeat
end tell
set volume 1
end perform_mail_action



[ Reply to This | # ]
How 'bout this one?
Authored by: applepal on Jan 16, '03 08:15:56PM

argh...

set adresbegin to offset of "<" in theText



[ Reply to This | # ]
How 'bout this one?
Authored by: russh on Jan 16, '03 09:15:40PM

Niiice. Fun script... though I think it would drive me nuts if I left it on for ALL messages. ;)

In addition to the typo you mentioned, you also need to delete the last "end if".. it's extra.



[ Reply to This | # ]