| Article: |
The Power of mdfind | |
| Subject: | mdfind2 | |
| Date: | 2006-01-05 18:09:06 | |
| From: | schwa | |
| Forgive the self advertising - but you might also want to check out mdfind2 - a mdfind replacement that I wrote that outputs XML: http://toxicsoftware.com/blog/index.php/weblog/mdfind2/ | ||
Showing messages 1 through 2 of 2.
-
mdfind2
2006-01-06 11:00:41 kwidholm [View]
-
mdfind2
2006-01-07 22:42:12 schwa [View]
What you're suggesting is a mdls command that takes a --xml switch. You could then use something like:
mdfind -0 'foo' | xargs -o mdls --xml
Unfortunately mdls doesn't take a --xml switch. So I'd have to write a "mdls2" command and I bet someone would complain that "too bad you decrease its usefulness and adaptability by making it a standalone replacement for mdfind".
Of course if you truly wished to harness the "flexibility and power of the command line tradition" then you could take the output of mdfind, pipe it through xargs and mdls and then through some awful sed/awk/perl abomination to convert the output of mdls into xml... I'm sure it would be extremely graceful, easy to use and easy to maintain...



mdfind "search terms" | mdxml > found_items.xml
Assuming you would then change the name of your program to mdxml.
You don't have to worry about making and maintaining an interface to mdfind functionality, and users can do so much more with your tool.