Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.4: More expressive saved searches' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: More expressive saved searches
Authored by: adrianm on May 07, '05 02:55:15AM
Weird mix you've got there; surely:

(kMDItemContentTypeTree = 'com.adobe.pdf') || (kMDItemContentTypeTree = 'com.adobe.postscript')
would be better?

[ Reply to This | # ]
10.4: More expressive saved searches
Authored by: njnystrom on May 07, '05 01:10:41PM
Yes, that's much cleaner. I noticed this too a few hours after submitting the hint. ObHint: To figure out the type of a particular file, you can just do mdls on the file from the terminal.

---
Nate

[ Reply to This | # ]

10.4: Using Unix 'mdfind' and spaces in names different from old 'find' syntax, but how?
Authored by: meckardt on May 09, '05 10:36:47AM
Okay here is the Script, which does not work because of the spaces in filenames and paths:

for i in `mdfind "kMDItemKind=='*Adobe Photoshop file*' && kMDItemColorSpace =='*CMYK*' && kMDItemResolutionWidthDPI > '72'"`

do
cp $i /Users/meckardt/Desktop/
done
 
Result:
cp: Tiger: No such file or directory
cp: 2005/3908497213.psd: No such file or directory
cp: /Volumes/Macintosh: No such file or directory

I know it must be possible, but how? I am totally stuck. How am I supposed to write a script with mdfind and use the results for cp or mv? The pathnames do have a lot Spaces and mdfind & xargs do not behave the same as find & xargs did before.

Thanks, Matt

[ Reply to This | # ]

10.4: Using Unix 'mdfind' and spaces in names different from old 'find' syntax, but how?
Authored by: huzzam on May 10, '05 04:06:34AM

Try putting double quotes around the $i, thus:

cp "$i" /Users/meckardt/Desktop/



[ Reply to This | # ]