• 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
How to find the menu
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to find the menu


  • Subject: How to find the menu
  • From: "Adolf.Peter" <email@hidden>
  • Date: Tue, 02 Aug 2011 15:33:33 +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.
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

  • Follow-Ups:
    • Re: How to find the menu
      • From: KOENIG Yvan <email@hidden>
  • Prev by Date: Re: Batch update of properties of an object
  • Next by Date: Can't find the menu item of the context menu.
  • Previous by thread: Re: Batch update of properties of an object
  • Next by thread: Re: How to find the menu
  • Index(es):
    • Date
    • Thread