Re: Can't find the menu item of the context menu.
Re: Can't find the menu item of the context menu.
- Subject: Re: Can't find the menu item of the context menu.
- From: Bill Cheeseman <email@hidden>
- Date: Tue, 02 Aug 2011 05:23:47 -0400
On Aug 2, 2011, at 3:43 AM, Adolf.Peter wrote: But when I run this script, it failed at line "get count every UI element of menu 1 of editbox".
Error: System Events got an error: Can't get menu 1 of text area 1 of scroll erea 1 of window "Untitled" of application process "TextEdit". Invalid index.
With accessiblity tools, I found the menu is under text area.
GUI Scripting runs up against a bug in TextEdit. Technically, there is a mismatch in the accessibility hierarchy in this situation, where the menu knows it has a parent object (the text area) but the text area does not know it has a child object (the menu). You can see the menu in Apple's Accessibility Inspector and in UI Browser's screen reader because screen readers traverse the hierarchy from the UI element visible on the screen (the menu) up through parent after parent until they reach the application. GUI Scripting (and UI Browser's browser view) traverse the hierarchy in the other direction, from the application down through child after child until they get to the text area -- and then, because of the bug in TextEdit, they can't see the menu.
There is no solution until Apple fixes TextEdit. File a bug report. In the past, Apple has been very quickly responsive to my reports of hierarchy mismatch bugs like this. |
_______________________________________________
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