3

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 com.apple.recentitems.plist file with defaults delete com.apple.recentitems 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).

4

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);
    LSSharedFileListRemoveAllItems(recentDocsList);
    NSLog(@"Cleared files!");
  }
   return 0;
}
  • can you share your method of compilation? or perhaps link to a downloadable version? – iconoclast Mar 5 '16 at 3:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .