Skip to content

Instantly share code, notes, and snippets.

@Sut3kh
Created March 2, 2012 16:20
Show Gist options
  • Save Sut3kh/1959428 to your computer and use it in GitHub Desktop.
Save Sut3kh/1959428 to your computer and use it in GitHub Desktop.
Reset all windows to primary screen for the given application
set _app to text returned of (display dialog "Reset application: " default answer "Google Chrome")
set _offset to 30
set x_start to 100
set y_start to 15
set _width to 1550
set _height to 1000
set new_col_at to 3
tell application _app
set last_x to (_offset * (count windows)) + x_start
set new_y to y_start
repeat with x from 1 to (count windows)
set new_x to (last_x - (_offset * x))
set bounds of window x to {new_x, new_y, _width, _height}
if (x mod new_col_at) is 0 then
set new_y to y_start
else
set new_y to new_y + 30
end if
end repeat
end tell
@tomgco
Copy link

tomgco commented Mar 2, 2012

Nice, I will be using this =]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment