2 # Copyright © 2016 Jamie Zawinski <jwz@jwz.org>
4 # Permission to use, copy, modify, distribute, and sell this software and its
5 # documentation for any purpose is hereby granted without fee, provided that
6 # the above copyright notice appear in all copies and that both that
7 # copyright notice and this permission notice appear in supporting
8 # documentation. No representations are made about the suitability of this
9 # software for any purpose. It is provided "as is" without express or
12 # Deliver random rotate and shake gestures to the iOS Simulator window.
14 # To make this work, you probably need to go to "System Preferences /
15 # Security & Privacy / Privacy / Accessibility" and add "Terminal.app"
16 # to the list of allowed programs.
18 # Created: 18-Apr-2016.
23 #proc="SystemUIServer"
27 tell application \"$sim\" to activate
28 tell application \"$proc\"
30 tell menu bar item \"Hardware\" of menu bar 1
31 click menu item \"$which\" of menu \"Hardware\"
41 i=$[ 2 + $[ RANDOM % 5 ]]
42 echo "sleep $i" ; sleep $i
44 if [ $i == 0 ]; then menu 'Shake Gesture'
47 if [ $i == 0 ]; then menu 'Rotate Left'
48 elif [ $i == 1 ]; then menu 'Rotate Right'
49 else menu 'Rotate Right' ; menu 'Rotate Right'