Skip to content

Instantly share code, notes, and snippets.

@ckwang8128
Created August 8, 2012 20:35
Show Gist options
  • Select an option

  • Save ckwang8128/3298447 to your computer and use it in GitHub Desktop.

Select an option

Save ckwang8128/3298447 to your computer and use it in GitHub Desktop.
AppleScript to play Google's Basketball Doodle. Start Chrome, then run this, move to Chrome, press the play button on the doodle. Watch it go!
tell application "Google Chrome"
tell window 1
set newTab to make new tab with properties {URL:"https://www.google.com/doodles/basketball-2012"}
end tell
delay 5
beep
delay 0.2
tell application "System Events"
set x to 1
tell process "Google Chrome"
repeat 12 times
log x
set x to x + 1
key down space
delay 0.15
key up space
end repeat
repeat 17 times
log x
set x to x + 1
key down space
delay 0.27
key up space
end repeat
repeat 13 times
log x
set x to x + 1
key down space
delay 0.7
key up space
end repeat
repeat 20 times
log x
set x to x + 1
key down space
delay 0.8
key up space
end repeat
end tell
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment