In Finder when I type something in the textbox the default is to search the whole mac in the contents of the files. I was able to change the default to search the current directory, but didn't see an option to change search for contents to search for file name. How can that be changed?

link|improve this question

74% accept rate
feedback

4 Answers

On 10.6 you could either:

  1. Add <key>SearchNameOnly</key><true/> to the SearchCriteria dictionary in /System/Library/CoreServices/Finder.app/Contents/Resources/default_smart.plist
  2. Replace default_smart.plist with a normal .savedSearch saved in Finder

Neither option seems to work on Lion though.

link|improve this answer
1  
Alternatively, enter sudo /usr/libexec/PlistBuddy -c "Add :SearchCriteria:SearchNameOnly bool true" /System/Library/CoreServices/Finder.app/Contents/Resources/default_smart.plist in Terminal. sudo /usr/libexec/PlistBuddy -c "Delete :SearchCriteria:SearchNameOnly" /System/Library/CoreServices/Finder.app/Contents/Resources/default_smart.plist to undo. – Daniel Beck May 12 '11 at 5:26
feedback

this hint might help. Make sure to read the comments too.

link|improve this answer
feedback

For anyone new Googling over to this tip, in Snow Leopard, the last tip worked, the first ones did not. I followed every step twice.

Mine works perfect. Here it us for those who don't want to guess....

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CompatibleVersion</key>
    <integer>1</integer>
    <key>RawQuery</key>
    <string>((_kMDItemGroupId &gt; 6))</string>
    <key>SearchCriteria</key>
    <dict>
        <key>CurrentFolderPath</key>
        <string>/</string>
        <key>FXCriteriaSlices</key>
        <array>
            <dict>
                <key>SearchNameOnly</key>
                <array>
                    <string>kMDItemKind</string>
                    <integer>300</integer>
                    <integer>400</integer>
                </array>
                <key>displayValues</key>
                <array>
                    <string>Kind</string>
                    <string>is</string>
                    <string>any</string>
                </array>
                <key>rowType</key>
                <integer>0</integer>
                <key>subrows</key>
                <array/>
            </dict>
        </array>
        <key>FXScope</key>
        <integer>0</integer>
        <key>FXScopeArrayOfPaths</key>
        <array>
            <string>kMDQueryScopeComputer</string>
        </array>
    <key>SearchNameOnly</key><true/>
    </dict>
    <key>Version</key>
    <string>10.4</string>
</dict>
</plist>
link|improve this answer
I apologize if anyone can't read the code I pasted into the comment I made. It appears there is a character limitation on this site. if you match this segment of code, it works: <key>FXCriteriaSlices</key> <array> <dict> <key>SearchNameOnly</key> <array> Good luck... After years of wanting this, I finally thought to look for and find a solution. Thanks to the users who posted above me. Chuck – Chuck May 2 '11 at 19:59
feedback

The above worked, and I thought I'd spell out the steps.

After locating the Finder Application (System/Library/CoreServices/Finder.app), Change the Finder app with Get Info to allow read/write by your user admin account. New Control-click the Finder and Show Package Contents. Look for the default_smart.plist file here: System/Library/CoreServices/Finder.app/Contents/Resources/default_smart.plist

Copy the file default_smart.plist out to desktop (save an original elsewhere as well just in case), edit in TextEdit, and insert the line <key>SearchNameOnly</key><true/> before the end of that dict grouping here:

    <key>SearchNameOnly</key><true/>
</dict>
<key>Version</key>

Then save and replace the file default_smart.plist in it's location: System/Library/CoreServices/Finder.app/Contents/Resources/default_smart.plist (you will need to authenticate with a password to save changes to the Finder)

link|improve this answer
You don't need to change the permissions of Finder.app. Or copy that plist to the desktop or anything. – Lri Apr 26 '11 at 23:12
feedback

Your Answer

 
or
required, but never shown

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