• 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
Re: Finding the focused UI element
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finding the focused UI element


  • Subject: Re: Finding the focused UI element
  • From: Arjen Baarsma <email@hidden>
  • Date: Thu, 17 Jul 2008 21:27:00 +0200

Thank you very much for your reply Bill.

activate application "TextEdit"
tell application "System Events"
    tell (first application process whose frontmost is true)
        get value of attribute "AXFocusedUIElement"
        perform action "AXShowMenu" of result
    end tell
end tell


I'm afraid that your little script script does not work for me actually (did have TextEdit open btw). What I get is the error message: "The variable result is not defined."


The problem is that when I ask for the value of the attribute "AXFocusedUIElement" of any application, I don't get anything back. It does know that the attribute exists because it would give an error message about that otherwise, but assigning it to a variable means that variable will remain undefined.
I'm still running OS X 10.4.11 (yes, I'm a cheapskate) and I saw in one of your other e-mails that you're using OS X 10.5.4, so I've asked someone running Leopard to run the script and it worked there. It therefore seems quite likely that my problem has been fixed in Leopard (which doesn't do me any good at the moment unless I decide to buy Leopard).


– Arjen

p.s. Sorry, should've sent the reply to the mailing list instead of to you directly. _______________________________________________
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
References: 
 >Re: Finding the focused UI element (From: Bill Cheeseman <email@hidden>)

  • Prev by Date: Re: Simple Display Dialog confusion
  • Next by Date: Re: UI scripting question
  • Previous by thread: Re: Finding the focused UI element
  • Next by thread: Re: Finding the focused UI element
  • Index(es):
    • Date
    • Thread