I like to tag files with xattr, e.g. xattr -w user.foo bar myfile
. Is there a way that I can then use Spotlight to search for a given xattr key (or key-value pair)? E.g.
Is there a way that I can then use Spotlight to search for a given xattr key (or key-value pair)? For example, if I put foo
or foo:bar
in the Spotlight search bar, I'd like it to return myfile
in the result list.
I realize you can do this by writing the com.apple.metadata:_kMDItemUserTags
attribute - but this is not very portable, so I'm curious if this can be extended to all xattr tags.