Page 1 of 1

Help "wrapping" a terminal command

PostPosted: Tue Sep 17, 2019 10:19 am
by Dave61
I want to run a terminal command if a file matches certain conditions.

The command clears any comments that the file has.
Code: Select all
xattr -d com.apple.metadata:kMDItemFinderComment name.ext
This works fine in a terminal window, but I am clueless about how to "wrap" this as an embedded script (AppleScript or other flavour).

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.

Re: Help "wrapping" a terminal command

PostPosted: Tue Sep 17, 2019 11:01 am
by Mr_Noodle
You want to use the "Run shellscript" action. The path to the file is sent as $1. You probably should also use the full path to the xattr command.