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: "Adolf.Peter" <email@hidden>
- Date: Thu, 04 Aug 2011 09:48:25 +0800
Thanks Bil for your reply.
I also try to get the context menu on the other cocoa apps, but the result is also fail. Even though I created a new app with TextFiled, I still can't get the context menu which pops from TextFiled. Is it by design issue? Do we have the other way to get the context menu?
Thanks,
Peter
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.
--
Bill Cheeseman - email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden