See [this question][1]
You'll need to give the script *access for assistive devices* in, depending on OS version, Accessibility, or Security and Privacy System prefs.

  [1]: http://stackoverflow.com/questions/12803847/set-position-of-window-with-applescript