Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am looking for a way to reload/refresh the "apple symbol" menu in the upper left corner from the terminal.

Searching for ways to refresh the menu has only led me to find the command

killall -KILL SystemUIServer

this only reload the "widgets" on the right side of the menu and not the content on the left.

I am looking for a way to do this since I have emptied the "recent files" menu programatically (by removing the info from the file with defaults delete RecentDocuments) but it doesn't show up. (I know that it is possible to turn off the recent files menu completly but that is not what I want).

share|improve this question
up vote 4 down vote accepted

So I finally found a solution to this.

I compiled the following Objective-c code and call it through the terminal.

#import <Foundation/Foundation.h>

int main(int argc, const char * argv[])

  @autoreleasepool {
    LSSharedFileListRef recentDocsList = LSSharedFileListCreate(NULL, kLSSharedFileListRecentDocumentItems, NULL);
    NSLog(@"Cleared files!");
   return 0;
share|improve this answer
can you share your method of compilation? or perhaps link to a downloadable version? – iconoclast Mar 5 at 3:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.