Re: Problems with AXSize Attribute of some applications
Re: Problems with AXSize Attribute of some applications
- Subject: Re: Problems with AXSize Attribute of some applications
- From: Peter Lübke <email@hidden>
- Date: Fri, 25 Feb 2011 17:40:13 +0100
Hi Benedikt,
if you just need the size of the window without the need to rely on
the application properly supporting Accessibility, you can check
whether you can retrieve it with AppleEvents.
The easiest way to find out is to run a script like this in Script
Editor:
tell application "Google Chrome"
bounds of every window
end tell
If this returns reasonable results, you know that you can send an
AppleEvent to the application asking for the bounds of the window
your'e interested in, either with NSAppleScript or AppleEvents (the
latter probably being way faster).
Cheers,
Peter
Am 25.02.2011 um 13:43 schrieb Benedikt Iltisberger:
Hey Peter,
first of all: Thank you for the reply.
I used the UIElementInspector before to verify the values. They are
as I described. Also if I traverse the whole element hierarchy.
The only thing I could do is to sum the height values up while I
traverse the hierarchy but this seems to be a really dirty way.
Maybe you could check the problem with UIElementInspector and
Chrome at your system. Maybe this is a local problem of my system.
But I suspect Chrome to be the villain.
Do you see an opportunity to get a stable window size when I select
the title UIElement of a application window?
The problem is that I cannot handle all programs with strange
behavior manually.
Thanks again.
Cheers,
Benedikt
P.s. Beste Grüße aus Bonn :-)
On 25.02.2011, at 13:17, Peter Lübke wrote:
Which element is returned for kAXFocusedWindowAttribute - is it
really the window? You can verify this with AccessibilityInspector
(UIElementInspector).
Do you get the same garbage when you track the window traversing
the whole element hierarchy : AXApplication -> kAXWindowsAttribute
-> AXWindow ?
Cheers,
Peter
Am 25.02.2011 um 08:15 schrieb Benedikt Iltisberger:
Hello everybody,
I ran into troubles with reading the AXSize attribute using the
Accessibility API.
The AXSize attribute (using the kAXFocusedWindowAttribute) should
return the size of the whole window.
But some applications like Google Chrome return the value of the
current UIElement (in this case the title bar) instead of the
size of the whole window.
In this cases I receive a height of 36 instead of 500.
To get the correct value I have to select a lower area of the
chrome window. But I need to get the whole window size when I
select the window's title bar.
With all standard Apple application this works great but some
none standard applications return garbage like chrome.
What can I do to handle this problem. I really ran out of ideas.
Thanks for you help in advance.
Kind regards
Benedikt
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden