Running shell script with ImageMagick on files

Hi all!
I'm trying to run a shell script on images dropped into a particular directory to strip EXIF data:
I'm trying to use the "embedded script" feature, but it doesn't seem to work; when I try to preview the rule all that shows up in the "Rule Status" window is "Error processing shell script on file xxxx.jpeg". The commands work when run from a shell script file, but when I try to have Hazel run the script file it doesn't return an error, but the image still has its EXIF data.
To make sure the script was being run, I added
Thanks for any assistance!
Ron
I'm trying to run a shell script on images dropped into a particular directory to strip EXIF data:
- Code: Select all
# Get the ICC profile for the image
magick $1 $1.icm
# Strip the original image, adding back the ICC profile
# to a new file
magick $1 -strip -profile $1.icm $1_stripped
# Remove the original file and rename the new file
mv -f "$1_stripped" "$1"
# and remove the icc profile file
rm $1.icm
I'm trying to use the "embedded script" feature, but it doesn't seem to work; when I try to preview the rule all that shows up in the "Rule Status" window is "Error processing shell script on file xxxx.jpeg". The commands work when run from a shell script file, but when I try to have Hazel run the script file it doesn't return an error, but the image still has its EXIF data.
To make sure the script was being run, I added
- Code: Select all
echo "yay" >> zzz.txt

Thanks for any assistance!
Ron