Help "wrapping" a terminal command

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Help "wrapping" a terminal command 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.
Dave61
 
Posts: 113
Joined: Tue Jul 10, 2012 4:56 pm

Re: Help "wrapping" a terminal command 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.
Mr_Noodle
Site Admin
 
Posts: 11230
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support