Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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
add comment

3 Answers 3

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 "com.apple.preference.displays"
    tell application "System Events" to tell process "System Preferences" to tell first window to click button "Gather Windows"
    quit
end tell

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

share|improve this answer
add comment

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
add comment

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
add comment

Your Answer

 
discard

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.