6

I would like to create a tool that allows you to set windows to exact sizes on the pixel scale to be able to have more precise screen divisions.

For example, if I had four Terminal windows (and I didn't have something cool like iTerm to do this for me), I'd like to be able to set each one to 1/2 screen height and 1/2 screen width, and people to position them via x, y coordinates so that they took up the entire screen, and exactly one fourth of them individually.

Can this be done using applescript?

6

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 "Finder" to set the bounds of the front Finder 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.

  • Also, is there a preset variable of the screen resolution? – JShoe Aug 6 '13 at 5:02
  • 1
    No, but you can run system_profiler SPDisplaysDataType | grep Resolution in iTerm to get the screen resolution. Or open up System Profiler and it should tell you. One more thing to try is to use the bounds property of a window in AppleScript: you can make a Finder window open completely (drag to fill entire screen) and then run tell application "Finder" to get the bounds of the front window in AppleScript and it will return the bounds, which represents the area of the window. – sameetandpotatoes Aug 6 '13 at 5:08
  • How do I tell it to go to the full bounds of the csreen if I don't know what they are? – JShoe Aug 6 '13 at 5:26
  • If you expand the Finder window so that you know it is at its maximum width and height of your screen and then execute tell application "Finder" to get the bounds of the front window, this will return the area of the window which is the full bounds of the screen. It will return it in this format: {72, 90, 512, 481}. – sameetandpotatoes Aug 6 '13 at 5:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .