Help "wrapping" a terminal command

I want to run a terminal command if a file matches certain conditions.
The command clears any comments that the file has.
I have read the Noodlesoft FAQ and tried a few variations but I am flying blind.
Please could somebody point me in the right direction.
The command clears any comments that the file has.
- Code: Select all
xattr -d com.apple.metadata:kMDItemFinderComment name.ext
I have read the Noodlesoft FAQ and tried a few variations but I am flying blind.
Please could somebody point me in the right direction.