Re: Is AXUIElementCreateSystemWide() A Tree I can Parse?
Re: Is AXUIElementCreateSystemWide() A Tree I can Parse?
- Subject: Re: Is AXUIElementCreateSystemWide() A Tree I can Parse?
- From: John Louch <email@hidden>
- Date: Sat, 1 Aug 2009 19:56:35 -0700
the system wide element only allows you to get a few things. If you
want all windows you will have to get all apps on the system then get
each of the applications AXWindows.
You also might want to look at CGWindow.h in
ApplicationServices.framework.
Thanks,
jl
On Aug 1, 2009, at 5:21 PM, aaron smith wrote:
Sorry, that psuedo code came through nastily, here it is again
broken up:
sysWide = AXUIElementCreateSystemWide();
NSArray *children = NULL;
AXUIElementCopyAttributeValue(sysWide,
(CFStringRef)NSAccessibilityChildrenAttribute, (CFTypeRef *)
&children)
for each (child in children)
{
NSString *role = NULL;
AXUIElementCopyAttributeValue( child,
(CFStringRef)NSAccessibilityRoleAttribute, (CFTypeRef *)&role)
if( [role isEqualToString:NSAccessibilityApplicationRole] ){
//look through application children for AXWindowRoles
}
}
On Sat, Aug 1, 2009 at 5:18 PM, aaron
smith<email@hidden> wrote:
Hey All, quick question. I'm working on a project where I need to get
a reference to all windows. The accessibility API seems the way to
go.
I've read most of the documentation I can find for the accessibility
API and I pretty much get it.
However, I can't seem to find if the system wide AXUIElementRef can
be
parsed like a tree. Basically, what I think I'm trying to do is
something like this::
(psuedo code)
sysWide = AXUIElementCreateSystemWide();
NSArray *children = NULL;
AXUIElementCopyAttributeValue(sysWide,
(CFStringRef)NSAccessibilityChildrenAttribute, (CFTypeRef *)
&children)
for each (child in children)
{
NSString *role = NULL;
AXUIElementCopyAttributeValue( child,
(CFStringRef)NSAccessibilityRoleAttribute, (CFTypeRef *)&role)
if( [role isEqualToString:NSAccessibilityApplicationRole] ){
//look through application children for AXWindowRoles
}
}
Once I get the systemWide element ref I can't get any further.
Any ideas?
Thanks much!
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (Accessibility-
email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
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