OS X: How to resize an off-screen window?

When I switched from two monitors to one (I have an external monitor at work), one of my XTerm windows was left in a state where it’s resize handle is off-screen. I can’t resize it, nor can I move it, since it’s already at the top of the screen.

Any tips or freeware for fixing this problem?

Mac OS X v10.5 Leopard
Advertisement

Mac OS X v10.5 Leopard is packed with over 300 new features, installs easily, and works with the software and accessories you already have.

63 thoughts on “OS X: How to resize an off-screen window?

  1. This is definitely my #1 OSX pain point. It happens to me with Quicksilver all the time when switching from my desktop monitor to my laptop screen.

    I just found this tip:

    I don’t know how well it works, but it would make my day if it did.

  2. I run into this problem all the time as well. Really annoying.
    Hopefully window management will improve with Leopard.
    I’d love to hear about a freeware fix for this. The Applescript tip works, but I’d like something more automatic.

  3. Ha. I surfed the web some more and came up with a solution.
    And I thought I’d share it here. You still have to select the offending window, for example using Expose and then hit a keyboard shortcut.

    Create this Applescript in Script Editor and save it under ~/Library/Scripts/

    tell application "System Events"
        set FrontApplication to (get name of every process whose frontmost is true) as string
        tell process FrontApplication
            set position of window 1 to {0, 22}
            --window 1 is always the frontmost window.
        end tell
    end tell
    

    Then set up a Quicksilver keyboard trigger for the script and you are set.

  4. Hi Hendrik,

    Thanks for posting your script! For some reason, as written (and with the quotes and dashes fixed :-)), it didn’t work on my system, so I had to tweak it a bit so that it didn’t think the script itself was the frontmost application:

    tell application "System Events"
        tell (a reference to (first process whose frontmost is true))
            set visible to false
        end tell
    end tell
    
    tell application "System Events"
        set FrontApplication to ¬
            (get name of first process whose frontmost is true) as string
        --display dialog "FrontApplication = " & FrontApplication
        try
            tell process FrontApplication
                set position of window 1 to {0, 22}
                --window 1 is always the frontmost window.
            end tell
        on error
            display dialog "Exception - FrontApplication = " & FrontApplication
        end try
    end tell
    
  5. A similar problem that’s frustrated me has to do with a finder window which contains rows of icons which exceed the size of the window. I would like to be able to drag the bottom row of icons down to make room for new rows of icons directly above the bottom row. I used to be able to solve in previous OS X versions (I believe Jaguar). I could shrink the window, use the scrollbar to scroll to the bottom row, then expand the window to create space at the bottom and move the icons. In Panther and Tiger, this feature was taken away. Now if I expand the window, the rows of icons move with the window and leave no space at the bottom. Is there a something I’m missing or a solution available (assuming you understand my explanation). Thanx, RW

  6. Hi,
    I just wanted to add on to this, as I had terrible difficulty, and couldn’t get either script to work (being rather a novice), and I’m ashamed to admit – neither could I work out how to add the keyboard shortcuts, even using quicksilver (great little app, by the way).

    What I did want to add though, was that my problem was with Parallels desktop. I’ve just found out that the XP window inside the Mac OS, doesn’t have a re-sizing handle, and that you have to set two different display resolutions – one for the XP window inside the Mac OS, and one for full screen XP (which also sometimes alter of their own accord.)

    Hope this helps someone.

    (Also, shift + Ctrl with click is right click under Parallels – something else I just found out!)

    Emma

  7. I want to create a quiksilver trigger to change the size of the first window to either the left half or the right half.
    Please tell me if one can do it.
    I tried this, but it didn’t do anything.

    set YSize to 1050
    set XSize to 1680
    tell application “System Events”
    set FrontApplication to (get name of every process whose frontmost is true) as string
    tell process FrontApplication
    set y1 to 22
    set x1 to XSize/2
    set x2 to XSize
    set y2 to YSize
    set bounds of window 1 to {x1, y1, x2, y2}
    end tell
    end tell

  8. I just stumbled across this blog after having the same problem with a Finder window that exceeded the bottom of my display. I found that for me changing the dock position in System Preferences resized the offending window. I moved the dock back and everything is back to normal.

  9. You can just option click the zoom button. This will expose the You can then resize the window.

  10. Choose Zoom off the Window menu and the offending window (if it is frontmost) will get within the bounds of the screen.

    I had this problem in Excel all the time–some freak program code would make my sheets be all tucked way up under the menu bar and ungrabbable. Took me ages to realize that I could just Window>Zoom to tame them.

  11. At the moment I have the reverse program. I am trying to get an Applescript to tuck a window part way up under the menu bar, but no matter how tucked up I set it for, it always only goes up until it hits the menu bar.

    So, frankly, I don’t know how some of these programs manage (even inadvertantly) to make their windows go up into the ungrabble zone.

  12. Just ran into this with the VMware Fusion main “library” window being so far offscreen (to the right) that the zoom button itself was inaccessible.

    Since I was running in dual-monitor mode (the laptop screen on the right, main monitor on the left) I was able to regain control by temporarily turning on “mirroring” in the display preferences, then turning it off again.

  13. I have this problem with Eclipse but it is as if Eclipse is stuck in full screen mode. It will not budge and there is no Window option to zoom or minimize/maximize. Rather frustrating. Is there any AppleScript parts that can be suggested?

  14. When I had this problem with Eclipse, I just resized my monitor resolution and OS.X collected all the windows to fit into the smaller resolution.

  15. I’m still having this problem with Eclipse. Neither resizing my monitor nor running either AppleScript worked, and there is no window menu to speak of. I don’t know who to be frustrated with more: the Eclipse developers, or Apple. This is such a ludicrously simple UI thing that I’m amazed this is such a problem.

  16. By the way, for those who are having this problem in Eclipse, the best solution I’ve found is to just “reset perspective” from the main Eclipse window (which, if you’re anything like me, is not the window you’re having problems with).

  17. Hated to be a noob and ask someone, but was reading through trying to figure out the problem,
    couldnt believe how easy a fix the zoom was…
    i’ve been living with a messed up window forever. lol.

  18. The zoom or the + button works great to re-size the window and get it back on the screen. Thanks for that.
    However, I there is a similar problem that it does not solve.

    I don’t know the official term for this UI element, but sometimes a windows will create a drop down panel or pane which descends from the top as an attached sheet or page. Got that? To see an example take a look at the apple mail (mail.app) program. Mail > Preferences > Rules. Select a rule > EDIT rule. The rule specifications are shown on drop down pane (or panel or sheet). This pane is not re-sized when the window is re-sized by the zoom or the (+) button.

    The rule pane is taller than my screen and I cannot reach the corner to re-size it. I also cannot get to the (Cancel) or (OK) buttons at the bottom of the screen to dismiss the panel. The rule “News From Apple” that is pre-configured has many conditions and is too long to close. This is on leopard on a MacBook. How could this slip by testing?

    Any ideas on how to re-size this pane.

  19. best and quickest thing to do is go into settings / displays – then temporarily choose a different display setting that will show the window with tab. shorten the window with the (now visible) tab and revert to your previous display setting. Good LUCK!

  20. I had the same issue with iTunes – the window/zoom did not help, it was just switching between the two views. However, when I kept the alt key while selecting the window/zoom from the menu, I got the whole window back on my screen.

  21. When I get this problem, I close the app and trash its prefs. This resets the window position back to its default (usually top-left of the left-hand monitor).

    MacHD –> Users –> MacHD –> Library –> Preferences

    Good luck,
    bekwkw

  22. Go to System Preferences –> Displays and select any other resolution and then select back your preferred resolution. This will make all windows’ size to fit into the resolution you have chosen. Voila! Solved!

  23. Thanks SO MUCH for that applescript!

    I run TD Ameritrade’s Command Center and
    like most Java apps, it’s a bit dumb about
    windows under OS X Leopard.

    Did the trick!

    Foob

  24. Here’s another solution: activate Spaces, and drag the window from there 🙂

  25. Option clicking the zoom button (upper right corner) didn’t work for me. However, option clicking the zoom button and then option clicking the green button did the job.

  26. Same problem for me. Sadly the change of screen resolution didn’t work for me, however the AppleScript worked great. Thank you very much!

  27. Hold down Alt (also called Option) key, then click on green button in window. Problem solved.

  28. Option-clicking the green button didn’t work for me, and we shouldn’t have to ditz with scripting to fix things like this. That’s Apple’s job.

    I finally fixed my one problem (a Mail rules window) by switching screen resolutions a few times.

  29. Maybe this is a simple approach but it worked for me.

    1. Change resolution to something other than your current setting.
    2. Change resolution back to original resolution.

    🙂

    P.S. If the window doesn’t get sized properly, resize will in secondary resolution.

  30. Thanks bekwkw!! Your solution (delete the application’s preferences file) was the ONLY one that worked for me. I’m running Leopard on a Power Mac G5. I’m not a newbie but I definitely didn’t feel like running any applescripts. Deleting a file is SO much easier 🙂 Thanks a billion!

    -Bill-

  31. You don’t need any applescripts whatsoever to fix an off-screen resize problem like the one described in the OP.

    Just change the resolution of Mac OSX to a “stretched” resolution and then back to the optimal resolution. That will cause all windows currently opened to resize themselves accordingly.

    Hope that helped some people 🙂

  32. The window zoom thing works for most applications, but not for itunes! Max van der stam- THANK YOU!!!!

  33. TO solve this once and for all … in SnowLeopard create a service, addl utilities -> Run applescript, input none and add this script (modified Marc’s script):

    on run {input, parameters}
    tell application “System Events”
    set ActiveApp to ¬
    (get name of first process whose frontmost is true) as string
    try
    tell process ActiveApp
    set position of window 1 to {0, 22}
    set size of window 1 to {800, 600}
    end tell
    on error
    display dialog “Script failed on = ” & ActiveApp
    end try
    end tell

    return input
    end run

    Assign a shortcut and voila, solved! even in iTunes

  34. Thanks everyone, trying to resize my itunes window was driving me crazy. option/click on zoom did the trick. i can now go to sleep. Cheers!

  35. Changing screen resolution is not a solution if it is System Preferences that is off the edge of the screen!
    I’ve had trouble with some TVs where the menu bar is off the top of the screen so you can’t even get to the Apple menu.
    However, I found option F14 opened the Displays Preferences. But it was still an issue if that window was then out of sight.
    Another problem I have is with low screen resolutions, you can’t get to the bottom of a window that is taller than the screen. Why won’t it let me move a window above the menu bar?
    G.

  36. oh god, i’ve tried all of the above and still no success! my window doesnt have any of the options mentioned in the window option and the scripts come up with errors. I’ve resized my display many times and tried rearranging the screens and the dock but still had no luck at all. Trashing the preferences did nothing too 🙁

  37. I had the iTunes window problem. Zooming would simply change it to the miniplayer (…)

    Then I used Alt(Option for the veterans)-Zoom (the green “+” button) and it made the miracle.

    Gee, I never expected such a flaw from Apple’UI – having in mind that they *should* know that having the resize click area in only one spot (precisely the easiest to fall victim of oversizing / off-screen) would sometimes lead to trouble.

    In Windows, as long as you have a resizable window and two of the sides (one vertical and one horizontal) available, you can always fully resize. Same goes for just any corner.
    That’s a little better thought of.

  38. I changed my screen resolution in System Preferences > Displays to something lower (like 1280 x something) with that specific App open, and it changed the size for me automatically. Once you’ve changed the size of that app, you can change back to your regular resolution.

  39. tell application “iTunes”
    set bounds of window 1 to {50, 100, 100, 100}
    end tell

    (you can replace itunes with the name of the application you are using)

Leave a Reply

Your email address will not be published. Required fields are marked *