Make search by file name default in Finder

11

4

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?

tony_sid

Posted 2010-11-23T03:02:31.993

Reputation: 11 651

Anyone knows how to accomplish this for Mavericks/Yosemite? – Josep Valls – 2015-06-23T20:21:49.543

Or Sierra? Hmm... – Charlie Gorichanaz – 2017-05-29T19:52:08.727

Set App Shortcuts for Command F in Finder to "Find by Name…" https://apple.stackexchange.com/a/305041/34902

– Ivan Chau – 2019-06-20T16:06:11.477

Answers

4

On 10.6 you can either add <key>SearchNameOnly</key><true/> to the SearchCriteria dictionary in /System/Library/CoreServices/Finder.app/Contents/Resources/default_smart.plist or replace default_smart.plist with a normal saved search file. (And reopen Finder.) Neither option seems to work on Lion though.

You can also press ⌃⌘F (or ⇧⌘F on 10.6) to open a Spotlight window that is set to search by name by default.

Lri

Posted 2010-11-23T03:02:31.993

Reputation: 34 501

⌃⇧⌘F (Control Shift Command F) on El Capitan or above – Ivan Chau – 2019-06-20T15:56:50.160

2Alternatively, 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 – 2011-05-12T05:26:17.673

2

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)

user78465

Posted 2010-11-23T03:02:31.993

Reputation: 21

2

One more bit here that I don't see on the the page. After doing this you'll need to Relaunch the Finder. 1 Push option-command-escape, 2 select Finder, 3 click Relaunch. 4 Close the window using the little red x in the top left.

Jim Frac

Posted 2010-11-23T03:02:31.993

Reputation: 21

I edited my answer to add that. You can also secondary-click Finder's Dock icon while holding option and select Relaunch. – Lri – 2012-11-27T13:28:19.817

1

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>

Chuck

Posted 2010-11-23T03:02:31.993

Reputation: 21

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 – 2011-05-02T19:59:09.330

0

For those of you with recent OS 10X, simply open FInder, click on File in the top bar, go down to select "find" and then select "name" and matches in the two boxes left of the search window.

cmasonw

Posted 2010-11-23T03:02:31.993

Reputation: 1

1Thanks, that's useful. I wish there were an easy way to make that the default. – Andrew Swift – 2014-08-01T16:30:57.687

-1

Another way to set the finder to default "find by name" (validated on Mac OS X 10.8.5 Mountain Lion):

Here's a step by step:

  1. Open System Preferences
  2. Click on "Keyboard"
  3. Click on "Keyboard Shortcuts"
  4. Click on "Application Shortcuts" (on my system this was the last item located on the left-hand side window)
  5. Click the little "+" right below the right-hand side window
  6. Click on the "Application" menu and choose "finder.app"
  7. Click into the field "Menu Title:" and type "Find by Name..." (Type it exactly like that including the three dots. Don't type the quotes.)
  8. Click into the field "Keyboard Shortcut:" and press the command-key and F at the same time. It should look like this ⌘F
  9. Close System Preferences

That's it. Basically what you are doing is remapping the command-F key (⌘F) to "Find By Name".

Stepcraft

Posted 2010-11-23T03:02:31.993

Reputation: 1