3

When using Smartfolders in Mac OS 10.6.5, is it possible to choose where to search beyond the 2 button choices? One button is usually "This Mac' (too broad) and the other one is a folder that has never been the one I want - in fact, I would want to exclude a particular folder (ie the Library folder in my user directory).

Since we are given a choice of 2 places to query, why not any particular branch of the directory?

2 Answers 2

2

Ok, there’s a way to “hack” into SmartFolders and change the locations.

Rules:

  • You can’t do it from the UI
  • It involves having the smart folder saved
  • I wrote it in spanish a long time ago in a blog post (spanish)

For the sake of helping you (I’m assuming you don’t speak spanish), I’ll transcribe the relevant information here.

Please note that the blog explains how to add more than one location to the search, not how to exclude (something I don’t believe is possible).

So, the short version:

  1. Save your smart folder, the search location is really not important (we’re going to change it!) but make sure you use the searching “terms” that you want. Name it something like: IHATESMARTFOLDERS. Ok, you can name it differently if ya wish ;)
  2. Go to your ~/Library/Saved Searches and you should see your saved smart folder.
  3. Once you have located your smart Folder, you have to open it with a text editor like TextWrangler (or anything that can save Plain Text). Do not use Pages
  4. Once you have it in your favorite editor, go to the end. You’ll see something like this:
<key>FXScopeArrayOfPaths</key>
<array>
           <string>/Users/martin/Desktop</string>
</array>

Note My smart folder was created for searching on my Desktop.

Good. As you can see the path is in an Array. If you know something about arrays, you’ll know that they are a collection of items. This means we can go ahead and add more items to this particular collection:

For example:

<key>FXScopeArrayOfPaths</key>
<array>
         <string>/Users/martin/Desktop</string>
         <string>/Users/martin/Pictures/MacStuff</string>
         <string>/Users/martin/Pictures/Me</string>
</array>

I have added two more folders to my smart -not so smart- folder.

Now in order for this to start working you have to:

  1. Save the smart folder (remember to use plain text!)
  2. Restart Finder.

And voilà.

Sadly, I haven’t found a way to exclude a location.

3
  • Terrrific. I also discovered that I could do what I needed using the UI - after years with OS X I just discovered today that searches will be particular to the icon one has selected in the sidebar. Your method may help me in the future - I am using smart folders as a daily planner - I really like it - I can make file names containing several key words (tags) and then use pre-defined smart folders like SaDec25 for that particular day or LA_EVENTS for all appointments I might have in LA. Working out real well. Thank again, Allan Dec 12, 2010 at 6:52
  • Thanks again for the help. Do you know if the query language for smartfolders can do a boolean <OR> ? I would like a smartfolder that would include the files meeting a criteria OR a 2nd criteria. Only <AND> seems possible in smartfolders but this won't get me to where I need to go. Dec 19, 2010 at 0:09
  • @Allan I’m sure (but not 100%) that you can do (for example) kind:music OR kind:document and it will look either. The OR/AND must be uppercase. Example: I want to find music files or documents that contain the word america. Here’s the spotlight query: (kind:music OR kind:document) AND america Dec 19, 2010 at 9:26
0

There is a 3rd party app EasyFind which has more constraints and customizations for your searches. I use it much more than smart folders. EasyFind is free from the App Store.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .