Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mac OS X - programmatically resize windows

Tags:

macos

cocoa

I'd like to know how apps like Divvy, Cinch, SizeUp, etc. resize / move windows belonging to other applications? I know that this might involve private APIs. Or do they all use AppleScript? Are there any resources out there about how to do it?

like image 211
ryyst Avatar asked Feb 27 '11 21:02

ryyst


People also ask

What is the easiest way to resize a window on a Mac?

Most windows can be manually resized. Drag the window's edge (top, bottom, or sides) or double-click an edge to expand that side of the window.

How do I resize a Mac keyboard using windows?

To resize a window, put your cursor over the edge until you see a double headed arrow. 1. Hold down the Option key while resizing a window: This will resize the window equally on both sides. 2.


1 Answers

A while back I wrote about using AppleScript to do just that. Basically, do the following:

tell application "MyApp"
    set the bounds of the first window to {x, y, width, height}
end tell
like image 188
Jeff Kelley Avatar answered Dec 21 '22 03:12

Jeff Kelley