• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Is AXUIElementCreateSystemWide() A Tree I can Parse?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Is AXUIElementCreateSystemWide() A Tree I can Parse?
      • From: John Louch <email@hidden>
References: 
 >Is AXUIElementCreateSystemWide() A Tree I can Parse? (From: aaron smith <email@hidden>)

  • Prev by Date: Is AXUIElementCreateSystemWide() A Tree I can Parse?
  • Next by Date: Re: Is AXUIElementCreateSystemWide() A Tree I can Parse?
  • Previous by thread: Is AXUIElementCreateSystemWide() A Tree I can Parse?
  • Next by thread: Re: Is AXUIElementCreateSystemWide() A Tree I can Parse?
  • Index(es):
    • Date
    • Thread