Skip to content

Instantly share code, notes, and snippets.

@firesofmay
Created July 23, 2013 02:01
Show Gist options
  • Save firesofmay/6059310 to your computer and use it in GitHub Desktop.
Save firesofmay/6059310 to your computer and use it in GitHub Desktop.
global windowx
global mousex
tell application "Finder"
set boundlist to get bounds of window of desktop
end tell
set windowx to item 3 of boundlist as string
set mousex to do shell script "/Users/firesofmay/mybin/MouseTools -location | head -n 1"
delay 0.2
tell application "System Events"
key down option
try
repeat while (windowx = mousex)
keystroke tab
delay 0.2
tell application "Finder"
set boundlist to get bounds of window of desktop
end tell
set windowx to item 3 of boundlist as string
set mousex to do shell script "/Users/firesofmay/mybin/MouseTools -location | head -n 1"
end repeat
on error errStr number errorNumber
key up option
error errStr number errorNumber
end try
key up option
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment