(* $Id: wakeupcall.scpt,v 1.1 2006/06/03 19:35:01 jmates Exp $ The author disclaims all copyrights and releases this script into the public domain. Start music playing in iTunes, with a gradual volume increase. Good to trigger via an alarm for a gentle wake up call. *) tell application "iTunes" -- to preserve/return to old volume setting set oldvolume to sound volume set mute to false set sound volume to 0 -- no result if no such playlist try set target to playlist "Party Shuffle" --return target on error set sound volume to oldvolume return end try -- shuffle the music for different starting order (* grrr, cannot reshuffle Party Shuffle! set shuffle of target to false set shuffle of target to true *) play target -- wakeup call involves noise, return to higher value if previous -- setting too low if oldvolume is less than 25 then set oldvolume to 25 end if -- return to old volume setting slowly repeat with gusto from 2 to oldvolume by 1 set sound volume to gusto delay 0.3 end repeat end tell tell application "System Events" get properties get every process if UI elements enabled then tell process "iTunes" tell menu bar 1 pick menu item "Show Current Song" of menu "File" end tell end tell end if end tell