Skip to content

Instantly share code, notes, and snippets.

@phwd
Created October 26, 2011 00:44
Show Gist options
  • Save phwd/1315057 to your computer and use it in GitHub Desktop.
Save phwd/1315057 to your computer and use it in GitHub Desktop.
Wakeup in the morning
property tick : 2 -- raise volume level by this many each loop
property thismany : 1 -- seconds to wait before making next increment to volume
tell application "iTunes"
set snd to sound volume
set sound volume to 0
play playlist "wakeup" -- your playlist here
repeat
if (get sound volume) is greater than or equal to (snd - tick) then
set sound volume to snd
exit repeat
end if
set sound volume to (sound volume + tick)
delay thismany
end repeat
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment