2005/05/10 Smart Folders (Mac OS X)
Mac's Spotlight has the
ability to create "Smart Folders". If you click "Save" after
doing a Spotlight search, you'll be creating a plist file which by default
will be created in ~/Library/Saved Searches. It has a "savedSearch"
extension, and contains the necessary information about your
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
<string>(* = "fogpr1*"wcd || kMDItemTextContent =
"fogpr1*"cd) && (kMDItemContentType != com.apple.mail.emlx)
&& (kMDItemContentType != public.vcard)</string>
This is a "live" folder. If you have it open in Finder, and are
creating files in Terminal or anywhere else that will match the criteria,
those files will instantly appear in your view.
Note that the conditional string is much more complex than anything you
can type in Spotlight itself. You can use boolean logic with the
command line "mdfind", and have more control with the View Options
of a Spotlight search (especially be selecting "Raw Query"), but you could also manually edit this plist
to get exactly what you want.
I haven't yet thought of something I really need Smart Folders
for, but the idea does tantalize me. I could set up a smart folder
for each customer and thus automatically track any reference in
any document, no matter where I created it. I'm sure other
uses will come to mind. As GetInfo now includes "SpotLight Comments"
where you can add searchable metadata (it's "kMDItemFinderComment" if
you are hand-rolling searches), this could get quite interesting. For example,
a directory (Folder in Mac-speak) has no particular connection
with the type of data you intend to store in it, but you can tag it with anything you like with Spotlight comments.
Got something to add? Send me email.
Increase ad revenue 50-250% with Ezoic
More Articles by Tony Lawrence
Find me on Google+
© 2011-03-09 Tony Lawrence