Skip to content

Instantly share code, notes, and snippets.

@tentacode
Created March 1, 2017 12:46
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 tentacode/a7b3586ef77fd24e98bedd1c7502c6c5 to your computer and use it in GitHub Desktop.
Save tentacode/a7b3586ef77fd24e98bedd1c7502c6c5 to your computer and use it in GitHub Desktop.
AppleScript to reposition every app (that are not Finder or iTerm2) of one specific screen to center position and specific dimension
tell application "System Events"
repeat with p in (processes where background only is false)
tell p
if name is not in {"Finder", "iTerm2"} then
repeat with x from 1 to (count windows)
set winPos to position of window x
set xPos to item 1 of winPos
if xPos > 0 then
set position of windows to {100, 100}
set size of windows to {2340, 1240}
end if
end repeat
end if
end tell
end repeat
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment