|Sep 14, 2009, 06:50 PM||#1|
Writing an Applescript for New Mail
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"
tell application "Mail"
check for new mail
exists unread count
If true then
say "You've got mail" using "Ralph
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.
White Macbook, 2 GHz, 4 GB SDRAM, 320 GB HD; 16GB iPod Nano (fifth gen.); 16GB iPhone 4; 16GB Wi-fi iPad; Canon 50D
|Sep 14, 2009, 08:20 PM||#2|
Mail's a bitch to script.
This bit seems to work:
tell application "Mail" set x to unread count of inbox check for new mail delay 3 set y to unread count of inbox end tell if x = y then say "You have no new messages, bub" using "Ralph" else say "You've got mail" using "Ralph" end if
I'll leave it to you to add the other bits.
What looks large from a distance, close up ain't never that big.
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|Launching an AppleScript at startup||North Pacific||Mac Programming||7||Feb 28, 2011 03:08 PM|
|Need help writing an AppleScript||diccen||Mac Programming||1||Oct 10, 2009 12:19 PM|
|How do I write an Applescript to move a Filemaker window||LaraBethStone||Mac Applications and Mac App Store||0||Sep 7, 2007 03:01 PM|
|OK...can someone please write an app for video...||pfranzen||Mac Applications and Mac App Store||5||Jul 10, 2003 12:33 PM|
All times are GMT -5. The time now is 06:57 AM.