Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

The System Preference > Appearance > Number of recent items > Document setting is all-or-nothing.

Is the a way to [allow|prevent] additions to the Documents list based [File extension|Application|Kind]?

I might want Word documents to be in the list, but not images. Or allow VLC to include files, but not Xee.

An AppleScript would probably make sense.

** edit ** Tiptoe is a potential solution.

share|improve this question
add comment

2 Answers

It's not the individual applications that do this manually, it's controlled by Launch Services.

But, applications can decide to not add them to the recent files/applications menu by setting the flag kLSLaunchDontAddToRecents in LSLaunchFlags when calling e.g. LSOpenFromRefSpec.

Now you can either modify open-source applications yourself, or patch their binaries, or patch them in-memory e.g. using Input Managers. The first option is probably too much work, the others are just insane.

In essence, there's no (sane) way to change that behavior.


You can of course intercept changes to ~/Library/Preferences/com.apple.RecentItems.plist and through out all items in these lists with Names you don't like.

share|improve this answer
    
Can an AppleScript monitor/intercept changes to this file? Can an AppleScript act like a background process? –  Craig Feb 17 '11 at 21:50
    
@Craig I was thinking more along the lines of the File System Events API, but you could try modifying the new item alert folder action AppleScript. It could work, since changes to this plist are realized by replacing the existing file. It might lead to performance issues monitoring ~/Library/Preferences/, though. –  Daniel Beck Feb 17 '11 at 21:55
add comment

Disclaimer: I'm the creator of the Tiptoe application you mention in the edit to your question.

It does seem that Tiptoe may go some way to satisfying your requirements.

The following describes how Tiptoe works. This process could be used to develop a script or a program that performs a similar task. (I don't know enough AppleScript to know if this is possible to do it that way)...

  1. You open an application using Tiptoe. Tiptoe saves that applications preference files to a temporary location.
  2. The application is then opened using a call to NSWorkspace using an option to prevent it from being added to the System > Recent Items Applications list.
  3. Tiptoe waits for a message from NSWorkspace telling it when the application quits.
  4. When it detects that the application has been quit, it compares the list of recent items that it previously stored with those that are now in preferences.
  5. It removes the difference between the two (i.e. the files that you accessed during the current session with the application) from the System > Recent Items Documents list using Launch Services.
  6. It then removes the same items from the currently stored preferences.
  7. It removes the temporary files stored at step 1. as these are no longer needed.

The downside with using Tiptoe is that it only works with the specific applications that it has been built for, but new applications are added with each release and requests are welcome.

If you are interested in trying Tiptoe, it is available as a 15 day free trial when downloaded from the website.

share|improve this answer
add comment

Your Answer

 
discard

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.