Created
March 16, 2014 23:38
-
-
Save mdagost/9591478 to your computer and use it in GitHub Desktop.
Applescript to make a window jiggle back and forth at a configurable amplitude and frequency
This file contains hidden or 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
| #!/bin/bash | |
| #the amount of time in between shakes in seconds | |
| pause=$1 | |
| #amplitude is the amount of horizontal diplacement | |
| amp=$2 | |
| window_width=800 | |
| #calculate the position of the right side of the window | |
| x_pos_2=`expr $window_width + $amp` | |
| while [ 1 ] | |
| do | |
| osascript -e "tell application \"Safari\" to set the bounds of the front window to {0, 22, $window_width, 1024}" | |
| sleep $pause | |
| osascript -e "tell application \"Safari\" to set the bounds of the front window to {$amp, 22, $x_pos_2, 1024}" | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment