Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!


Click here to return to the 'Hack to search multiple folders' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
Hack to search multiple folders
Authored by: Aikinai on Tue, Apr 8 2008 at 6:22AM PDT

I figured out a hack to solve this problem and I just submitted a hint but I imagine it will be awhile before it shows up, so here's a copy for anyone who needs a solution soon:

In 10.5 Leopard, there is no way to do a smart search on multiple locations (and even searching one specific location is a pain). I've search everywhere and found no real solutions, but I've discovered it does work if you manually edit a previous saved search in a text editor. This is obviously no good for quick searches, but if you want to use a saved search as a smart folder, this method will work.

First make a search with the other criteria you want (date, filetype, etc), but any location and save it. Then go to /Users/Username/Library/Saved Searches/ and you will see the search you just made. I'm not sure what other text editors you can use, but I used Smultron and it worked great. I dragged the search to Smultron on the dock and it opened it as a text file. There are many keys where it lists the location of the search so I did a find and replace to change them all.

For example you might find:


		<array>
			<string>/Users/Username/Documents</string>
		</array>

and replace with:


		<array>
			<string>/Users/Username/Documents</string>
			<string>/Users/Username/Pictures</string>
			<string>/Users/Username/Music</string>
		</array>

Now, just save the file and when you click on the saved search, it will search all the locations.

This is obviously not the best way to do this, but it will work until Apple realizes we might still want to search based on folders.



[ Reply to This | # ]
Re: Hack to search multiple folders
Authored by: ammacdon on Thu, Oct 30 2008 at 12:50PM PDT
thanks Aikinai! that worked perfectly. i used it to search two specific folders on an external drive, so i set the CurrentFolderPath array to just the enclosing folder, and set SearchScopes and FXScopeArrayOfPaths arrays to the folders inside.

[ Reply to This | # ]
Re: Hack to search multiple folders
Authored by: ammacdon on Fri, Dec 12 2008 at 1:01PM PST
also, i forgot to note that the smart folder text file doesn't like escaped paths, e.g.: the kind you get when you drag a file in the terminal:

Bad:

		<key>SearchScopes</key>
		<array>
			<string>/Volumes/external\ hard\ drive/myfolder</string>
		</array>


Good:

		<key>SearchScopes</key>
		<array>
			<string>/Volumes/external hard drive/myfolder</string>
		</array>


[ Reply to This | # ]