Summary:
In iTunes 11, there is a mismatch in the accessibility hierarchy for the Devices popover.
Steps to Reproduce:
Run the following GUI Scripting script in AppleScript Editor:
activate application "iTunes"
tell application "System Events"
tell process "iTunes"
-- insert GUI Scripting statements here
click pop up button 2 of window "iTunes"
get name of attributes of pop up button 2 of window "iTunes"
end tell
end tell
The list of attribute names produced by this script omits "AXChildren", but it should have an "AXChildren" attribute that should include the popover.
Expected Results:
The Accessibility hierarchy is supposed to be consistent in both directions. Apple's UI Element Inspector developer utility shows that the value of the Devices popover's "AXParent" attribute is the Devices pop-up button. UI Element Inspector can see the entire hierarchy because it traverses the accessibility hierarchy from the "leaf" element on the screen up the "AXParent" hierarchy to the root application element. The hierarchy is correct in that direction.
Actual Results:
The GUI Scripting script above shows that AppleScript cannot see the Devices popover because the Devices pop-up button has no "AXChildren" attribute. It should have an "AXChildren" attribute whose value is an array containing the Devices popover UI element. GUI Scripting reads the accessibility hierarchy down the "AXChildren" tree from the root application element to the leaf element on the screen. The hierarchy is incorrect in this direction.
You can also see this error by using my UI Browser product <
http://pfiddlesoft.com/uibrowser>. .... Launch UI Browser, then click the Devices pop-up in iTunes 11 while at least one iOS device is present. Hover the pointer over the popover, and press UI Browser's system-wide hot key (Control-Command-S). The Devices pop-up button will be selected in UI Browser's main browser view, and you will see in the Attributes drawer that it has no children.
You can also see this in UI Browser's Screen Reader. Click UI Browser's Switch to Screen Reader button, then open the iTunes 11 Devices popover and hover the pointer over the popover. You will see the correct hierarchy looking up the "AXParent" tree, but you will see a notation that the Devices pop-up button has a MISMATCH -- no children, and you will see that the popover's AppleScript index is a large negative number equal to Cocoa's NSNotFound constant.
Regression:
This is the first release of iTunes 11.
Notes:
I have reported a dozen or more accessibility hierarchy mismatches like this in the past 10 years, and Apple has quickly fixed all of them. I hope you keep up the great record on this one!