views:

56

answers:

3

Is there a way to determine whether the active window (not of my process, but a different application) is resizable?

Edit: I would prefer to do this without applescript as it then depends on the application being scriptable.

A: 

Yes, you can check if the "frontmost window" of the target application is resizable! You can perform the scripting request via applescript, scripting bridge or a third party framework!

However, in any case, it's needed that the target application is scriptable and you can access to the "resizable" property (of the "frontmost window" object) via a scripting request!

BitDrink
Do you know of any third party frameworks that I could use? I would rather not depend on an application being scriptable.
Ryan
I don't know any framework that lets you accomplish what you are trying to do whether the target application is not scriptable! Moreover, I don't think there is a better way to do that!
BitDrink
A: 

Depends on how you're getting access to the window. There's a property in AppleScript on Window objects, resizable, that indicates this.

Ben Gottlieb
+1  A: 

Use Accessibility. Once you find the window you want to examine, test whether it has the kAXGrowAreaAttribute attribute (the value for which would be the grow area itself, a.k.a. the “size box” or [the Windows term] “resize handle”). A window that has one is resizable; a window that doesn't have one is not resizable.

The user will need to have access for assistive devices turned on, but making that happen is easier than scripting unscriptable applications.

Peter Hosey