Speak Sender Name Only AppleScript in Mail No Longer Working In Mountain Lion
Hi all, the title pretty much says it all.
I have a very simple AppleScript that I use as a rule in Apple Mail everytime new email comes in.
This AppleScript will speak only the sender's name. That's all I want it to say.
I there are two emails, it will say, "Mail From John Smith" followed closely by "Mail From Johnny Appletree", etc.
This works great in Lion as a Mail rule.
I have properly placed this AppleScript in the correct path for Mail scripts.
It's located in:
(user name)/Library/Application Scripts/com.apple.mail
I've popped in the sample script provided by Apple into this same path that speaks the total number of selected emails, the name and the subject, etc. That works fine, so I'm positive the path is correct. But that script says a bunch of items I don't need. I just need a simple script and I'm guessing somehow the conversion from Lion to Mountain Lion doesn't work for some reason with this script.
Anyone know how to modify this supposedly simple script to make it work in Mountain Lion?
Any help is most appreciated, thanks! 🙂
Here is the script I had been using in Lion as a Mail rule without any issues before Mountain Lion:
on perform_mail_action(info)
-- see if iTunes is playing
set itunes_playing to false
tell application "System Events"
if (get name of every process) does not contain "iTunes" then
set itunes_playing to false
else
tell application "iTunes"
if player state is playing then set itunes_playing to true
end tell
end if
end tell
-- pause iTunes if needed
if itunes_playing is true then tell application "iTunes" to pause
tell application "Mail"
set the_messages to |SelectedMessages| of info
repeat with a_message in the_messages
set the_sender to extract name fromsender of a_message
if (junk mail status of a_message) is not true then
say "Mail from " & the_sender
end if
end repeat
end tell
-- resume iTunes if it was playing before
if itunes_playing is true then tell application "iTunes" to play
end perform_mail_action
Mac Pro (Mid 2010), Mac OS X (10.7.2)