Script to move every window of current app to the same spot.

I have an app that I open a ton of windows in (100+) at once, and it cascades all of them when it opens the windows.

I’d love a script that could make the windows move to be right on top of each other rather than cascaded.

Does anyone know how to do this or know of a script that does this already? Is it relatively simple?

You might try the script below, where TextEdit is used as an example. Make sure that “Enable access for assistive devices” is checked under System Preferences > Universal Access.

Allow cascading windows to open as usual, and then run the script:

tell application "TextEdit" to activate -- replace TextEdit with your app
tell application "System Events"
	tell process "TextEdit" -- replace with your app
		try
			set all_windows to every window
			set the_position to value of attribute "AXPosition" of window 1
			repeat with a_window in all_windows
				set position of a_window to the_position
			end repeat
		end try
	end tell
end tell

A version of the script was tested with apps TextEdit, Preview and Safari using Mac OS 10.4.11. Hope this helps.

BRILLIANT. This worked PERFECTLY. You have no idea how much this is going to help me work faster.

I can’t thank you enough!