I'm trying to write a script that does a few things on wakeup every morning. So far, I've figured out how to open Safari with a particular URL, play a playlist in iTunes and get new mail. However, I'm having trouble with a little feature I thought would be nice. Here's what I've got so far:
say "Hey, wake up. I've got news for you." using "Ralph"
tell application "Safari"
open location "http://online.wsj.com/home-page"
end tell
tell application "Mail"
activate
check for new mail
mailbox "inbox"
exists unread count
If true then
say "You've got mail" using "Ralph
else
quit application
end tell
However, it's not working. I'd like to set it where after it checks for new mail, it says "You've got mail" using the voice "Ralph". I can't figure out for the life of me how to do that. I thought that I'd have to use a conditional, but it's not working. If you've got any ideas, I'd really appreciate them.
-Alex
say "Hey, wake up. I've got news for you." using "Ralph"
tell application "Safari"
open location "http://online.wsj.com/home-page"
end tell
tell application "Mail"
activate
check for new mail
mailbox "inbox"
exists unread count
If true then
say "You've got mail" using "Ralph
else
quit application
end tell
However, it's not working. I'd like to set it where after it checks for new mail, it says "You've got mail" using the voice "Ralph". I can't figure out for the life of me how to do that. I thought that I'd have to use a conditional, but it's not working. If you've got any ideas, I'd really appreciate them.
-Alex