Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.5: Change the Finder's default Find window Desktop
Want to tailor the Finder's Find (Command-F) window? Copy the following into TextEdit, make it plain text, and save it to the Desktop as default_smart.plist:
<?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 > 6))</string>
  <key>SearchCriteria</key>
  <dict>
    <key>CurrentFolderPath</key>
    <string>/</string>
    <key>FXCriteriaSlices</key>
    <array>
      <dict>
        <key>criteria</key>
        <array>
          <string>com_apple_SearchSystemFilesAttribute</string>
          <integer>1220</integer>
        </array>
        <key>displayValues</key>
        <array>
          <string>SEARCH_SYSTEM_FILES</string>
          <string>YES</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>
  </dict>
  <key>ViewOptions</key>
  <dict>
    <key>SidebarWidth</key>
    <integer>135</integer>
    <key>ToolbarVisible</key>
    <true/>
    <key>ViewHeight</key>
    <integer>582</integer>
    <key>ViewStyle</key>
    <string>icnv</string>
    <key>WindowBounds</key>
    <dict>
      <key>bottom</key>
      <integer>850</integer>
      <key>left</key>
      <integer>457</integer>
      <key>right</key>
      <integer>1207</integer>
      <key>top</key>
      <integer>268</integer>
    </dict>
  </dict>
  <key>Version</key>
  <string>10.5.3</string>
</dict>
</plist>
This version of Finder's search box shows the user's home folder as a place to search, includes all system files, is taller than the original window, and the cursor displays in the search box. Note that the ViewHeight field is the difference between bottom and top. So you can adjust it, and the window's width, to suit your needs.

To change the default Find window, run these commands in Terminal (don't type the $), pressing Return after each:
$ cd /System/Library/CoreServices/Finder.app/Contents/Resources 
$ sudo cp default_smart.plist default_smart.plist.bak
The first command changes to the proper directory, and the second one saves the original default search file, so you can restore the current behavior. Enter your admin password at the Password prompt when asked. To activate your modified search box, use this command:
$ sudo cp /Users/username/Desktop/default_smart.plist default_smart.plist
Replace username with your user's short username. To return to the original file, cd to that same directory in Terminal, then use this command:
$ sudo cp default_smart.plist.bak default_smart.plist
[robg adds: You'll need to kill the Finder for this change to take effect. We've covered this sort of edit before (1, 2), but this one adds the 10.5-specific ability to search system files.]
    •    
  • Currently 3.11 / 5
  You rated: 4 / 5 (9 votes cast)
 
[39,021 views]  

10.5: Change the Finder's default Find window | 37 comments | Create New Account
Click here to return to the '10.5: Change the Finder's default Find window' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.5: Change the Finder's default Find window
Authored by: tempel on Mar 07, '08 08:12:23AM
A suggestion.

Instead of this: sudo cp /Users/username/Desktop/default_smart.plist default_smart.plist
The article should suggest this: sudo cp ~/Desktop/default_smart.plist default_smart.plist

Those who are "dumb" users not to know what even a prompt is, this will be less of a problem to them. Those who know better can figure out how to set this for other users as well. No explanation necessary.

[ Reply to This | # ]

Command prompts for tempel
Authored by: parsons on Mar 14, '08 04:17:33AM
"Those who are 'dumb' users not to know what even a prompt is, this will be less of a problem to them."
I was a Sr. Consulting Engineer with Apple for three years in Education Development, during which time I was afforded the opportunity to meet a number of these 'dumb' users to whom you refer. Many of these people were PhD's who were at the forefront of their fields (and were able to articulate their thoughts in grammatically correct English). I would love to meet you. I can only presume you rank in the stratosphere of the world's intellectual elite.

[ Reply to This | # ]
Command prompts for tempel
Authored by: tempel on Mar 13, '09 08:46:08AM

First, I am not a native english speaker, meaning I am not so good in my choice of words.

Second, I put the word dumb in quotes on purpose. Doesn't that have any meaning in the english language?



[ Reply to This | # ]
10.5: Change the Finder's default Find window
Authored by: hamarkus on Mar 07, '08 09:01:48AM

For me it still starts search at 'My Mac' or / not in my user folder (and I have changed this key:
<key>CurrentFolderPath</key>
<string>/Users/hamarkus</string>
)

I really would like the behaviour to change such that it starts searching in the current folder not in /.



[ Reply to This | # ]
10.5: Change the Finder's default Find window
Authored by: McSvenster on Mar 07, '08 11:10:30AM

Same with me: I'd love to have the default search in the actual folder...

And in my configuration the plist- file does not change anything.

SK



[ Reply to This | # ]
10.5: Change the Finder's default Find window
Authored by: hamarkus on Mar 07, '08 11:29:26AM

Adding the system file to the default search by this method works for me.



[ Reply to This | # ]
10.5: Change the Finder's default Find window
Authored by: baltwo on Mar 07, '08 02:41:31PM

Me too! But I haven't figured out how to make that happen. I'd also like it to default to File Name and not contents, but I haven't figured out that one either.



[ Reply to This | # ]
10.5: Change the Finder's default Find window
Authored by: klktrk on Mar 08, '08 07:14:27AM

		<key>CurrentFolderPath</key>
		<array>
			<string>.</string>
		</array>
and

		<key>FXScopeArrayOfPaths</key>
		<array>
			<string>.</string>
		</array>
seem to be working for me. Haven't experimented enough to see whether I actually need both. I replaced wherever I saw the path with "."

---
The Apotek
http://theapotek.com
The Executioner's Summary:
http://www.last.fm/label/Broken+Hill+Music/playlists/6761?autostart

[ Reply to This | # ]

Does not work for me
Authored by: hamarkus on Mar 08, '08 09:15:38AM

Replaced in both the default_smart.plist and the alternate_smart.plist and relaunched the Finder. Still starts at /.



[ Reply to This | # ]
No good
Authored by: wireface on Mar 08, '08 10:22:05AM

No, sadly this doesn't seem to do anything. You still must manually click the current folder.

boo



[ Reply to This | # ]
10.5: Change the Finder's default Find window
Authored by: davidbk1 on Mar 07, '08 11:18:47AM

This is great. Does anyone know how to make the default also search only filenames, not contents?



[ Reply to This | # ]
10.5: Change the Finder's default Find window
Authored by: shenry318 on Mar 07, '08 01:46:33PM

interesting... why is the version string in your plist file you suggest creating 10.5.3???



[ Reply to This | # ]
10.5: Change the Finder's default Find window
Authored by: hamarkus on Mar 07, '08 02:19:59PM

The Finder of OS X 10.5.2 has the version 10.5.3 (and the Finder of OS X 10.5.1 had the version 10.5.2). Don't ask me why and when this difference was introduced.



[ Reply to This | # ]
10.5: Change the Finder's default Find window
Authored by: baltwo on Mar 07, '08 02:46:10PM

I did that to match the Finder version. Strictly a cosmetic fix.



[ Reply to This | # ]
Does anybody know how to switch
Authored by: tice on Mar 07, '08 02:12:32PM

... the window search to "this folder" by default. It's always "This Mac" and I usually just need the current folder.



[ Reply to This | # ]
Does anybody know how to switch
Authored by: baltwo on Mar 07, '08 02:43:41PM

Me too! But I haven't figured out how to make the home folder or File Name the default setting.



[ Reply to This | # ]
Does anybody know how to switch
Authored by: shenry318 on Mar 09, '08 10:54:35AM

I can't figure it out either. But did you notice if you use smart searching in a open or save dialog it works like you would expect. There are three buttons "Computer", a "home" button and also a button with the name of the current folder and it even remember which you last selected. Too bad command-F from the finder doesn't work this way... Maybe if someone could figure out which .plist file is setting the search in an open or save dialog box that might reveal some info.



[ Reply to This | # ]
10.5: Change the Finder's default Find window
Authored by: llee on Mar 08, '08 08:51:42PM
10.5: Change the Finder's default Find window
Authored by: baltwo on Mar 09, '08 01:07:48PM

I put this together, based on the one I did for Tiger, before I saw your implementation. Nice bit of scripting. Now, if we can figure out how to have the default show one or more folders as active, have File Name vice Contents active, have saved searches open with the search criteria enabled, and change the window's width, Spotlight might become what the engineers envisioned.



[ Reply to This | # ]
10.5: Change the Finder's default Find window
Authored by: johnsawyercjs on Mar 12, '08 12:50:48AM

"Spotlight might become what the engineers envisioned."

But due to the way Apple's engineers keep changing how Spotlight, and the Find utility throughout all versions of OS X, works, it's hard to tell whether Apple's engineers have anything particularly in mind at all. Find under OS 10.3.9 was quite good, but I guess Apple decided it was too good for us.



[ Reply to This | # ]
10.5: Change the Finder's default Find window
Authored by: sjk on Mar 15, '08 01:43:36PM

And what was Apple smoking when they replaced Date Modified with Last Opened in 10.5 Spotlight search results and eliminated customizable View Options? Has anyone figured out how to regain that lost functionality without using a third party Spotlight utility?

PS: Thanks for the Smart Folder Targeteer scripts, Laine. Going to give 'em a try later on my wife's eMac; I'm still satisfied running 10.4 on my iMac G5.



[ Reply to This | # ]
10.5: Change the Finder's default Find window
Authored by: hamarkus on Mar 09, '08 04:20:37AM
I have noticed that my new .plist file has an extended attribute (indicated by the @ at the end of the permissions listing as seen by ls -all). Calling:
$ xattr -l default_smart.plist
com.apple.FinderInfo:
0000 2A 2A 2A 2A 48 64 72 61 00 00 00 00 00 00 00 00 ****Hdra........
0010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

com.apple.TextEncoding: MACINTOSH;0

And in fact this .plist file has a file icon of the application I edited it with. I don't think the file icon really screws up things but the text encoding just might.

Trying to remove the extended attribute with:
$ xattr -d com.apple.FinderInfo default_smart.plist
No such xattr: com.apple.FinderInfo

That is strange.

[ Reply to This | # ]
sudo xattr -d works however
Authored by: hamarkus on Mar 09, '08 04:29:54AM

I am still a bit surprised where it picked up the file encoding 'MACINTOSH:0', but removing it did not fix anything.



[ Reply to This | # ]
sudo xattr -d works however
Authored by: baltwo on Mar 09, '08 01:19:23PM

I get:

$ xattr -l default_smart.plist
com.apple.TextEncoding: UTF-8;134217984

Additionally,

$ ls -el@ default_smart.plist
-rw-r--r--@ 1 me me 1456 Feb 29 19:46 default_smart.plist
com.apple.TextEncoding 15

I get nothing dealing with com.apple.FinderInfo or MACINTOSH;0



[ Reply to This | # ]
sudo xattr -d works however
Authored by: hamarkus on Mar 09, '08 01:44:58PM

Just blame SubEthaEdit, it added the file icon and generally does funny stuff with file encodings.



[ Reply to This | # ]
10.5: Change the Finder's default Find window
Authored by: FOOOD on Mar 09, '08 05:19:43AM

Does this also set the window width?

If not does anyone know how to set the window width? Every time I start a search normally the window is really narrow & I have to resize it, & also make the 'Name' column much wider. Would be great to be set a default window width with a wider 'Name' column.



[ Reply to This | # ]
10.5: Change the Finder's default Find window
Authored by: baltwo on Mar 09, '08 01:11:08PM

AFAICT, that's not doable. A saved search with a wider window, just pops up with the default setting. Unless you can figure out how to trigger the items as described in NSView.h, you'll have to live with the current behavior. Incorporating that is beyond my ken.



[ Reply to This | # ]
10.5: Change the Finder's default Find window
Authored by: cxd101 on Mar 10, '08 12:05:50AM

I'm not sure if my issue is the same, but if other .plist parameters can be modified in order to get what I'm looking for, I'll give it a shot. I have my folders organized by my major projects. Often when I am searching, I know exactly which folder has what I am looking for, and I just need to find the correct file in "that" particular folder. Under Tiger, using the search-field in the upper-right corner of an open finder window, if I entered the given search term in that search-field, the Finder would automatically default to starting the search (search-target) in "that" folder. Under Leopard, the default search-target is "This Mac". Question: what do I need to modify in this (or another) .plist file, such that all of my search-targets default to the folder that I am currently in, vs. "This Mac"?



[ Reply to This | # ]
10.5: Change the Finder's default Find window
Authored by: FOOOD on Mar 10, '08 03:53:30AM

Yea, sounds like you want it to behave the same way as I do.



[ Reply to This | # ]
10.5: Change the Finder's default Find window
Authored by: isogrifo on Apr 15, '08 11:51:17AM

I found how to modify the width... you have to change the four options under "WindowBounds" (bottom, left, right, top). If you do this, you can control where the window appears and how wide it is.



[ Reply to This | # ]
10.5: Change the Finder's default Find window
Authored by: McSvenster on Mar 10, '08 03:30:16AM

It seems to me that the search window in the Finder is kind off a preconfigured smart search. But I cannot find out, where its configuration files are.

I thought, that the defaults_smart.plist seems only to include the link to the default search: kMDQueryScopeComputer
I found something in MDQuery.h:

<code>
/*!
@function MDQuerySetSearchScope
@discussion Use MDQuerySetSearchScope to limit the results
returned by the query engine to those MDItemRefs that
appear within the specified directories. This may be
used to limit searching to particular volumes. Tilde
paths, or environment variables are not expanded.
Calling this multiple times will replace the previous
options. This must be called before the query is executed.
@param query The query object to modify.
@param scopeDirectories a CFArray of CFStringRef or CFURLRef objects which
specify where to search. For conveinience, the kMDQueryScopeHome,
kMDQueryScopeComputer and kMDQueryScopeNetwork constants may also
be present in this array.
@param scopeOptions additional options for modifying the search.
Currently, pass 0 (zero).
*/
</code>

As You can see I'm just poking around with little knowledge... But could it be, that there are just the two constants : kMDQueryScopeComputer and kMDQueryScopeNetwork where Finder starts in kMDQueryScopeComputer for searches?

Greetings
Sk



[ Reply to This | # ]
10.5: Change the Finder's default Find window
Authored by: johnsawyercjs on Mar 11, '08 11:37:55PM

You might want to fix permissions on any replacement or copy of the default_smart.plist file, once it's moved (back) into System/Library/CoreServices/Finder.app/Contents/Resources, and log out and back in, or even restart the Mac (not just relaunch the Finder) before you make use of the modified default_smart.plist, since the permissions of the replacement or copy won't match those of the original file, and in my experience, this can sometimes cause odd behavior (like Finder relaunching) when you try to open a Find window. Just dragging the default_smart.plist file to another location (from its original location of System/Library/CoreServices/Finder.app/Contents/Resources) (this will actually make a copy at the destination, not remove it from the source folder), will change the file's Owner from System, to the currently logged-in user, which for some reason the System doesn't like, even though Group for both the original and modified copy will still be "wheel", read/write.



[ Reply to This | # ]
10.5: Change the Finder's default Find window
Authored by: johnsawyercjs on Mar 11, '08 11:58:20PM

Hmm. The behavior I describe above was what I consistently found under OS 10.4.x, and I assumed it would also be true of 10.5. Wrong assumption. Behavior under OS 10.5 seems to be different when you drag some items out of System/Library/CoreServices/Finder.app/Contents/Resources--documents you drag out, will get moved to the destination, removing it from the Resources folder, and the file's permissions don't get changed. Maybe Apple changed the behavior in 10.5 to accommodate people dragging modified default_smart.plist files into the Finder's Resources folder? But dragging folders out of Resources, or items inside folders that are inside of Resources, copies them to the desination, leaving the original in Resources. Go figure.



[ Reply to This | # ]
10.5: Change the Finder's default Find window
Authored by: baltwo on Mar 13, '08 08:37:38PM

That's what I noticed, so I didn't mention it in the hint. IIRC, I didn't muck with the permissions on my changed plist in Tiger, either.



[ Reply to This | # ]
10.5: Change the Finder's default Find window
Authored by: teszeract on Jul 15, '08 11:25:06PM
My solution that works completely, but necessitates the use of a macro program.

Please see the screenshot. http://i36.tinypic.com/2djujpt.png

Essentially, one macro method is to set up a couple of button pushes. Done.

I think that every power user should invest in a macro program like Quickeys, iKey, Spark (free) etc.

[ Reply to This | # ]
10.5: Change the Finder's default Find window
Authored by: Frungi on Oct 15, '09 10:01:11PM

Is it possible to get Spotlight (non-Finder) search to include system files? I'd rather not have to switch apps to quickly open a chat log, for instance.



[ Reply to This | # ]
10.5: Change the Finder's default Find window
Authored by: kickingfog on Oct 28, '11 05:25:28PM

I found this info that I like for the default_smart.plist. It makes "Name" active, not "Content" when you use command-F. Plus the cursor is active for typing. If you want "content" you can use command-option-shift to open a Spotlight search window. This seems to work for 10.6 as well.

Here is the text:

<?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>criteria</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>


I hope the formating came through correctly. I've been looking for this simple fix for a long time. You can see, near the end of the text, is where it adds SearchNameOnly.



[ Reply to This | # ]