title: Move all windows to a single monitor (with two attached) in Mac OS X?
body: <p>Whenever I use my MacBook away from my desk and later plug it into an external display (as primary), I get into the state of having windows deposited in both the notebook monitor and the external one.</p>
  
  <p>To move all windows to a single screen, my current solution is to "Turn on mirroring" in the display preferences and then turn it off again. This is rather tedious, though. Does anyone know of a better way?</p>
  
  <hr>
  
  <p>I'm afraid the script posted by @<a href="https://stackoverflow.com/questions/39066/move-all-windows-to-a-single-monitor-with-two-attached-in-mac-os-x#39097">erlando</a> does absolutely nothing for me, running Mac OS X 10.5.4. (I.e., with windows on both screens, running the script moves not a single one of them, and it does not return any errors.) I guess I'll just have to stick with using the "mirror/unmirror" method mentioned above.</p>
  
  <hr>
  
  <p>@<a href="https://stackoverflow.com/questions/39066/move-all-windows-to-a-single-monitor-with-two-attached-in-mac-os-x#47233">Denton</a>: I'm afraid those links provide scripts for getting windows which are orphaned from <em>any</em> screen back onto the display. I ‘just’ want to move all windows from a secondary display onto the primary display.</p>