Skip to content

Instantly share code, notes, and snippets.

@williamcotton
Forked from akahn/standup.rb
Created November 16, 2010 16:29
Show Gist options
  • Save williamcotton/702018 to your computer and use it in GitHub Desktop.
Save williamcotton/702018 to your computer and use it in GitHub Desktop.
def play
`osascript -e 'tell application "iTunes" to play'`
end
def pause
`osascript -e 'tell application "iTunes" to pause'`
end
pause
(1..50).to_a.reverse.each do |n|
p n
sleep 1
end
play
i = 0
while i < 100
`osascript -e 'tell application "iTunes" to set sound volume to #{i}'`
sleep 0.1
i = i+1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment