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: aaron smith <email@hidden>
- Date: Sat, 1 Aug 2009 17:21:30 -0700
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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden