10.4: Change default Finder search criteria

Jul 01, '05 09:07:00AM

Contributed by: englabenny

Tiger only hintWhen you type cmd-F in Finder, you are presented with two already filled-in criteria; Kind: Any and Last Opened: Any Date. While it's nice as a first-timer user to see the options available, we would like to change this default to something more reasonable.

A reasonable default would be a search without any criteria. I'll show you how that can be done, as well as how to set it to my favorite: Items opened today. The interesting file we have to change is:

/System/Library/CoreServices/Finder.app/Contents/Resources/default_smart.plist
To find this file, select the path in Safari (or other Cocoa browser) and choose Finder -> Reveal from the Services menu (in the application's menu). Copy the file to a working directory, for example, your home folder. This file can be edited with the Property List Editor if you have Developer Tools installed, but it's also easily edited with a Text editor -- you just have to be careful about syntax.

To remove the default criteria alltogether, replace the criteria array with an empty array. Replace...

<key>FXCriteriaSlices</key>
<array>
    // here are the criteria
</array>
with this...
<key>FXCriteriaSlices</key>
<array/>
To change to a default where the criteria is "Last Opened: Today," instead replace the above section with this code:
<key>FXCriteriaSlices</key>
<array>
    <dict>
        <key>FXSliceKind</key>
        <string>Slsv</string>
        <key>Value</key>
        <string>DAto</string>
    </dict>
</array>
When you have changed your working copy of the file, back up the Finder application and drag the working copy into the Finder Resources folder. The Finder will prompt for an administrator password; enter a password and then logout and login (or restart Finder) to try your tweaks.

If you want to find out which FXCriteriaSlices you want to put in, it's easy. The default_smart.plist file is basically identical to a saved search file, with some attributes like view options removed. Experiment by saving a search that has the criteria you are interested in, and open that saved search in a text editor. You should be able to recover values for FXSliceKind and Value to suit your preference.

[robg adds: This is similar, but not identical to, this hint, which didn't provide as much detail on the editing process. I felt it was worth sharing on its own merits...]

Comments (10)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20050618105941143