-
-
Save williamcotton/702018 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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