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!

10.5: Use mdfind to run saved Spotlight searches UNIX
I noticed that mdfind has become much more useful now in Leopard. For instance, you can run Finder saved searches from the command line. As an example...
mdfind -s "Pet Pics"
...will show the results of saved search called "Pet Pics." It actually looks for the saved search in ~/Library/Saved Searches, but you can give it a full file path if you wish. This means you can build up your queries visually using Finder, then easily use them in scripts. Also, you can give mdfind queries in the same language that you'd use in Spotlight:
mdfind -interpret "pet kind:image"
As usual, check man mdfind page for more info, but note that the man page is not consistent with all that mdfind can do (eg, it doesn't mention -s in the man page).
    •    
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[6,263 views]  

10.5: Use mdfind to run saved Spotlight searches | 3 comments | Create New Account
Click here to return to the '10.5: Use mdfind to run saved Spotlight searches' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
10.5: Use mdfind to run saved Spotlight searches
Authored by: JimAkin on Mon, Dec 31 2007 at 10:44AM PST
FWIW, this seems to work in OS X 10.4.11, too.

---
Jim

[ Reply to This | # ]
10.5: Use mdfind to run saved Spotlight searches
Authored by: KidneyPi on Tue, Jan 1 2008 at 8:12AM PST
The man page doesn't mention this, but the usage info does. Run mdfind without any arguments and it will show this option. It won't show the interpret option.

[ Reply to This | # ]
10.5: Use mdfind to run saved Spotlight searches
Authored by: wgscott on Tue, Jan 1 2008 at 4:52PM PST
Anyone know how to do the inverse operation, i.e., save the search pattern as a saved search xml file?

[ Reply to This | # ]