title: Positioning a window with AppleScript using dual monitors
body: <p>I have two monitors set up and I am trying to position the window of an application in the second monitor but nothing I do seems to work. For example I am using my laptop and the terminal window is maximized on the screen. Then I plug in an external monitor. I then want to run the applescript and have the terminal maximize on the larger second monitor.</p>
  
  <p>Here is what I have right now:</p>
  
  <pre><code>set monitorTwoPos to {1050, -600}
  set monitorTwoSze to {1200, 1920}
  
  tell application "Microsoft Outlook"
      set position of window 1 to monitorTwoPos
      set size of window 1 to monitorTwoSze
  end tell
  </code></pre>
  
  <p>Here is the error I get: </p>
  
  <pre>
  /Users/vcutten/AppleScripts/SpacesWork.scpt:1291:1332: execution error: 
  Microsoft Outlook got an error: Can’t make position of window 1 into type specifier. (-1700)
  </pre>
  
  <p>I'm pretty sure I'm just using set position and set size completely wrong :( When I used bounds it kind of works...</p>
  
  <p>Bonus Question:
  How can I loop through the open windows and get their size? Thanks!</p>