• 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: clear apple menu's recent items script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: clear apple menu's recent items script


  • Subject: Re: clear apple menu's recent items script
  • From: kai <email@hidden>
  • Date: Thu, 13 Apr 2006 19:02:30 +0100


On 13 Apr 2006, at 18:20, Jeff Hobbs wrote:

Does anyone have any idea why this wouldn't work? I'm guessing it's because the Apple Menu is kind of an odd menu, programatically, but maybe my syntax is off? Or is there a better way to do this?

try
	tell application "System Events"
		tell process "Finder"
			tell menu bar 1
				tell menu bar item "Apple"
					tell menu "Apple"
						tell menu bar item "Recent Items"
							tell menu "Recent Items"
								click menu item "Clear Menu"
							end tell
						end tell
					end tell
				end tell
			end tell
		end tell
	end tell
end try

Very close, Jeff. Try replacing:

tell menu bar item "Recent Items"

with:

--------
tell menu item "Recent Items"
--------

The click also seems to register faster/more effectively when the target process is frontmost:

--------

tell application "System Events" to tell process "Finder"
	set frontmost to true
	click menu item "Clear Menu" of menu "Recent Items" of ¬
		menu item "Recent Items" of menu "Apple" of ¬
		menu bar item "Apple" of menu bar 1
end tell

--------

---
kai


_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >clear apple menu's recent items script (From: Jeff Hobbs <email@hidden>)

  • Prev by Date: Re: clear apple menu's recent items script
  • Next by Date: KeyBoardSetUpAssistant (Off Topic)
  • Previous by thread: Re: clear apple menu's recent items script
  • Next by thread: Re: clear apple menu's recent items script
  • Index(es):
    • Date
    • Thread