Created
March 2, 2012 16:20
-
-
Save Sut3kh/1959428 to your computer and use it in GitHub Desktop.
Reset all windows to primary screen for the given application
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice, I will be using this =]