I use this one w/ iCal to wake me up:
try
tell application "iTunes"
activate
set this_playlist to (playlist named "WAKEUP STUPID")
play this_playlist
end tell
end try
― THE JAMES DEAN OF THE OLD TESTAMENT (ex machina), Monday, 27 June 2005 04:39 (twenty years ago)
set state to 0 -- This state means that we think that I am home because of Bluetooth.
try
tell application "iSync"
activate
synchronize
do shell script "sleep 45" -- for some reason there seem to be some races here... it should work fine
if sync status is (not 1) then
set state to sync status -- This means I am not home. Try Emailing
end if
quit
end tell
on error
set state to 1
end try
if state is 1 then
-- email cellphone here
try
tell application "Mail"
set theSender to "me@gmail.com"
set theAddress to "me@fone"
set theSubject to "Wakeup Jon."
set theBody to "There's probably something you need to do soon."
set newMessage to make new outgoing message with properties {subject:theSubject, content:theBody, sender:theSender, address:theAddress}
tell newMessage
make new to recipient with properties {address:theAddress}
end tell
send newMessage
end tell
on error
set state to 2
end try
end if
if state is not 1 then -- Try to wake me with iTunes
try
set volume 100 -- sys
tell application "iTunes"
activate
set sound volume to 100 -- itunes
set this_playlist to (playlist named "WAKEUP STUPID")
play this_playlist
end tell
on error -- play anything to wake me up
set state to 3
end try
end if
if state is 3 then -- uhhhhhhh
try
tell application "iTunes"
set this_playlist to (playlist named "Library")
play this_playlist
end tell
on error
set state to 4
end try
end if
if state is 4 then -- UGHHHHH
try
say "Good mornin', good mornin'!We've danced the whole night through,good mornin', good mornin' to you. Good mornin', good mornin'! It's great to stay up late, good mornin', good mornin' to you."
beep
beep
beep
beep
beep
beep
beep
beep
end try
end if
― THE JAMES DEAN OF THE OLD TESTAMENT (ex machina), Monday, 27 June 2005 06:22 (twenty years ago)