2

I've recently bought a Henge Dock, and like the ability to plug my MacBook in and instantly reconnect to all my peripherals (external monitor, keyboard, mouse, etc.).

The only problem is that when I dock or undock, all of my windows are left at the wrong size (either too big or too small) and I have to manually resize them, one by one. Not the end of the world, but ... isn't there an easier way?

I've seen Cinch and Sizeup, but they seem to only work on one window (the current app). I looked at the Automator as a possible way to do this, but it didn't seem to have any window operations. I also tried the AppleScript listed here, but it put the windows in wacky places.

1 Answer 1

6

Here's that AppleScript code:

property excludedApplicationNames : {"Safari", "iTunes", "Transmit"}
tell application "System Events" to get the name of every process
repeat with theProcess in the result
    set theProcessName to theProcess as string
    if theProcessName is not in excludedApplicationNames
        tell application "System Events" to set position of windows of process theProcess to {75, 140}
    end if
end repeat

If the only issue you have with it is where it puts your windows (which wouldn't be a surprise, as the asker there wanted all his windows positioned in a single spot), then change that one line to put them where you want.

or…

If you want a third-party utility to do the work for you, you might like Stay from Cordless Dog.

1
  • Thanks, @Dori. Stay is exactly what I need. I should have been more specific; the issue isn't that it didn't put the windows in the right spot, it's that it put windows for different apps in different spots. Some were off the top of the monitor, some were correctly positioned, and some were indented away from the top right corner. I suppose I could tweak it for each one, but that seems crazy. :)
    – Ian Varley
    Jan 4, 2011 at 4:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .