Set size of window to exact pixels, and place via x, y coordinates
Yes, this can be done using AppleScript. Read this link to understand the code and then try and implement it yourself for your specific situation.
Here is another link that describes the bounds of a window in detail.
Example:
tell application &quot;Finder&quot; to set the bounds of the front window to {24, 96, 524, 396}

would set the Finder window to be in the top left corner.
Mac App Store- BetterSnapTool:
Note: I would check out BetterSnapTool. It does exactly what you want for $1.99. I use it myself and I find it invaluable, especially at such a low price.