How to find files not containing comment x? I try to find all "*.xyz" files in folder x which does not have comment "abc". This code does the opposite. I would prefer to use Spotlight if possible. How i can do this?

Thanks

do shell script "mdfind -onlyin '/path/to/folder/x' kMDItemFinderComment == 'abc' kMDItemFSName == '*.xyz'"
The expression has to be a single argument. Subexpressions can be joined with &amp;&amp;:

mdfind 'kMDItemFinderComment!=abc&amp;&amp;kMDItemFSName=*.xyz' -onlyin /path/to/folder/x