Skip to content

Instantly share code, notes, and snippets.

@jnothman
Last active April 20, 2017 03:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jnothman/f794197abeb2da4ff6470ac791d014eb to your computer and use it in GitHub Desktop.
Save jnothman/f794197abeb2da4ff6470ac791d014eb to your computer and use it in GitHub Desktop.
Apple script to get windows back on screen
#!/usr/bin/osascript
on run argv
set l to 0
set t to 0
repeat with j from 1 to (count argv)
set a to item j of argv
tell application a
repeat with x from 1 to (count windows)
set b to bounds of window x
set w to item 3 of b - item 1 of b
set h to item 4 of b - item 2 of b
set bounds of window x to {l, t, w + l, h + t}
end repeat
end tell
end repeat
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment