Upgraded to Mavericks the other day and noticed this script no longer works.
tell application "System Events" to 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 of (first process whose frontmost is true)
Not sure how to fix it any help would be grand. Thanks
Worked for me!
Copied your code into AppleScript Editor and ran it. First time it asked me to allow the AppleScript Editor access for such processes and brought up a dialog box where I accepted the AppleScript Editor to run such processes. Second time, it worked perfectly.
Here is a self localizable version checked on French Mavericks.
tell application "System Events"
set RecentItems_loc to localized string "Recent Items" from table "InfoPlist" in bundle POSIX file "/System/Library/CoreServices/CoreTypes.bundle" --
end tell
tell application "System Events" to click last menu item of menu 1 of menu item RecentItems_loc of menu 1 of menu bar item 1 of menu bar 1 of (first process whose frontmost is true)
Yvan KOENIG (VALLAURIS, France) mardi 29 octobre 2013 18:29:52
Sorry, I restarted my mac and ran the script again and it worked. It was giving me a Application not Running Error. I am glad the fix was as easy as a restart, just hope it not a reoccurring issue.