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


Click here to return to the 'this script announces name & subject with mac system voices' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
this script announces name & subject with mac system voices
Authored by: darndog on Mar 21, '03 01:47:54PM

knocked this up from scripts in this thread & some apple finder scripts, it will announce the name (not email address) and subject. I set the Mail Rule to 'Sender is in Address Book'.

******** cut & paste text below into script editor ********

on perform_mail_action(info)
tell application "Mail"
set selectedMessages to |SelectedMessages| of info
repeat with eachMessage in selectedMessages
set theFromAddress to sender of eachMessage
-- seperate name from email address
set theBreak to " <"
set nameEnd to the offset of theBreak in theFromAddress
if nameEnd is not 0 then
set fromPerson to (characters 1 through nameEnd of theFromAddress) as string
end if
-- determine if this is a reply
set theSubject to subject of eachMessage
if theSubject contains "re:" or theSubject contains "Re:" then
set speechText to "Reply from " & fromPerson & ". Subject is " & theSubject
else
set speechText to "New mail from " & fromPerson & ". Subject is " & theSubject
end if
-- You can change 'Victora' below to any other system voice
say speechText using "Victoria"
end repeat
end tell
end perform_mail_action

****************************************************
It gets very old very fast if you get 10+ messages at once, :)

darndog



[ Reply to This | # ]
this script announces name & subject with mac system voices
Authored by: cilly on May 12, '04 12:25:17PM

This is nice, but how do I set the script to use the alert sound output device rather than the default sound output?

---
cilly @ http://www.cilly.dyndns.org/



[ Reply to This | # ]