• 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
GUI scripting menu item with leading spaces
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GUI scripting menu item with leading spaces


  • Subject: GUI scripting menu item with leading spaces
  • From: "Jim Clause" <email@hidden>
  • Date: Thu, 10 May 2007 17:34:33 -0400

Does any one have an idea on how to use GUI scripting to click a menu
item with a leading space.  I'm trying to access the Open Recent menu
of Preview but my script is failing.  Other nested menus, like the
Finder's View -> Arrange By -> Name work fine.

I'm tried writing my own script and using the so_submenu script from
http://www.apple.com/applescript/uiscripting/03.html both fail.

Here's my attempt that fails:
tell application "Preview" to activate
tell application "System Events" to click menu item "bug.jpg" of menu
1 of menu item "Open Recent" of menu 1 of menu bar item "File" of menu
bar 1 of application process "Preview"

However if I change the reference for the menu item from menu item "
bug.jpg" to menu item 1 everything works.  Unfortunately since the
Open Recent menu gets rearranged I can't rely on the items being in
the same place.


Thanks,

~Jim
_______________________________________________
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: GUI scripting menu item with leading spaces
      • From: deivy petrescu <email@hidden>
  • Prev by Date: Re: How do I append text at the end of a textedit document?
  • Next by Date: Re: GUI scripting menu item with leading spaces
  • Previous by thread: Re: get properties of elements of a Class in Applescript - Related to ical
  • Next by thread: Re: GUI scripting menu item with leading spaces
  • Index(es):
    • Date
    • Thread