Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to make myself a little script that I can run on the fly that gathers all my open windows onto the main display.

I think a good starting place would be to be able to trigger Gather Windows (as seen in System Preferences-> Displays) by a shell script, AppleScript, or Automator action.

Can anyone either tell me how to do the above, or point me at a utility that will let me bind a key to do gather windows (freeware preferred)?

share|improve this question
up vote 1 down vote accepted

Use AppleScript Editor to save the following as script or application:

tell application "System Preferences"
    set current pane to pane id ""
    tell application "System Events" to tell process "System Preferences" to tell first window to click button "Gather Windows"
end tell

Make sure you have enabled support for assistive devices in System Preferences » Universal Access.

share|improve this answer

This article includes an AppleScript that gathers all windows.

It's the only programmatic way I know of to mimic the behaviour of the "gather windows" command in System Preferences.

share|improve this answer
Doesn't work OMM. It just doesn't move the window onto the main screen... I do have Access for Assistive Devices enabled. – Nathan Greenstein Apr 27 '11 at 0:28

Have you looked at the following list to see if any of these do what you want?

What Window Management Options exist for OS X?

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.