Code / Applescript / Morning Alarm Script

  1. -- We need to up the alarm volume, or lower it incase
  2. -- we've forgotten to change it
  3. set volume 2
  4.  
  5. -- Open iTunes and play the good morning tunes
  6. tell application "iTunes"
  7.         play playlist "Wake Up Songs"
  8. end tell
  9.  
  10. -- Test whether or not Mail is running
  11. tell application "System Events"
  12.         set noMail to not (exists process "Mail")
  13. end tell
  14.  
  15. if noMail then
  16.         tell application "Mail" to activate
  17.         tell application "System Events"
  18.                 repeat until exists process "Mail"
  19.                         delay 1
  20.                 end repeat
  21.         end tell
  22.         delay 10
  23. end if
  24.  
  25. -- Now get Mail to activate and check for new messages
  26. tell application "Mail" to activate
  27. tell application "Mail" to check for new mail
  28.  
  29. -- We'll also get Adium on screen
  30. tell application "Adium" to activate
  31.  
  32.  
  33.  

Download as Text : January 6th, 2009