title: Objective C - how to resize a window programmatically with given window id?
body: <p>How to resize a window of any application programmatically with objective-c / cocoa? So far I've got the app name and the window number but don't know how to access the window.</p>
  
  <p>I could do it with AppleScript but want to learn it with objective c.</p>
  
  <p>AppleScript example:</p>
  
  <pre><code>tell application "System Events"
      set frontApp to name of first application process whose frontmost is true
  end tell
  
  
  tell application frontApp
      set bounds of window 1 to {(screenWidth / 2), 0, screenWidth, screenHeight}
  end tell
  </code></pre>
  
  <p>Thanks for any advice.</p>