Can't find the menu item of the context menu.
Can't find the menu item of the context menu.
- Subject: Can't find the menu item of the context menu.
- From: "Adolf.Peter" <email@hidden>
- Date: Tue, 02 Aug 2011 15:43:05 +0800
Hi guys,
I have an issue about accessibility when I write applescript.
1.Open TextEdit at first.
2.Run the script:
--------------------------------------------------------
tell application "System Events"
tell process "TextEdit"
-- Active application
tell application "TextEdit" to activate
-- Open context menu
set editbox to UI element 1 of scroll area 1 of window 1
tell editbox to perform action "AXShowMenu"
-- Get count of menu item in the context menu
get count every UI element of menu 1 of editbox
end tell
end tell
---------------------------------------------------------
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.
What caused this issue? Accessiblity or the script?
Thanks,
Peter
_______________________________________________
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