Lost window, can't get it back, can't script it back...

Discussion in 'macOS' started by SamFen, Nov 10, 2009.

  1. SamFen macrumors newbie

    Joined:
    Nov 10, 2009
    #1
    Hi all,

    I use a lap top that is usually connected to a high-resolution external monitor. When I disconnect, usually things behave, but occasionally the windows of certain programs will end up way out off the screen.

    Today I have a Thunderbird window that is far away (Mozilla apps are common victims/causes of this problem). Normally I would just quit and restart, but I don't trust it to save the draft of this important email.

    Here are the facts: The window is way off to the left. There is no one-pixel still on my main monitor. If I use F11 to see all Thunderbird windows, they swish in from the left, but if I select one they swish out again. Ditto if I minimize and maximize again.

    I found a applescript that is supposed to fix this. It doesn't work so I added the dialogs to debug it (I'm new to applescript -- how to I get it to just print messages?):

    Code:
    tell application "Thunderbird"
    	repeat with i from 1 to (count of windows)
    		display dialog "window " & i
    		tell window i
    			set {x1, y1, x2, y2} to bounds
    			display dialog " " & x1 & " " & y1 & " " & x2 & " " & y2
    			set bounds to {0, 0, x2 - x1, y2 - y1}
    			set {x1, y1, x2, y2} to bounds
    			display dialog "" & x1 & " " & y1 & " " & x2 & " " & y2
    		end tell
    	end repeat
    end tell
    
    When I run the script, it correctly finds Thunderbird, and it knows that I have two windows open. For the bounds, it first prints out "-1121, 359, -119, 1118" (so, yeah, waaaay off the screen). After it is supposed to move it, it doesn't, and the dialog confirms that the bounds haven't changed.

    How do I get my windows back? :mad:

    Any help greatly appreciated. :)
     
  2. richard.mac macrumors 603

    richard.mac

    Joined:
    Feb 2, 2007
    Location:
    51.50024, -0.12662
    #2
    what if you press control-command-Z to Zoom the window? (make sure Thunderbird is the active application)
     
  3. SamFen thread starter macrumors newbie

    Joined:
    Nov 10, 2009
    #3
    Nothing happens. I tried "Zoom" from the window menu as well. Nothing.
     
  4. richard.mac macrumors 603

    richard.mac

    Joined:
    Feb 2, 2007
    Location:
    51.50024, -0.12662
    #4
    oh yeah whoops... i forgot OS X actually had a menu bar there for a sec.

    i guess youve already tried plugging it back into the monitor?
     
  5. SamFen thread starter macrumors newbie

    Joined:
    Nov 10, 2009
    #5

    WAIT!!!! I tried again and it worked this time!


    No idea why it didn't work several times before... :confused: Thanks!

    Well, anyway... Any clues as to why the script didn't work?
     
  6. richard.mac macrumors 603

    richard.mac

    Joined:
    Feb 2, 2007
    Location:
    51.50024, -0.12662
    #6
    nope, sorry… worked with Firefox though, it went to the top left of the screen.
     

Share This Page