exiftool is not working via automator

Started by MHut, June 26, 2024, 08:41:14 PM

Previous topic - Next topic

MHut

Hi guys,

Can you think of any reason why shell script below would not work on Apple Silicon Mac OS? It works fine on Intel Mac but on the Mac Studio machine with M2 Ultra chip is only doing color tagging

for f in "$@"
do
    ext="${f##*.}"
   
    if [[ "$ext" =~ ^(jpg|jpeg|png|tif|tiff|psd)$ ]]; then
        # Run exiftool to remove JUMBF tags
        /usr/local/bin/exiftool -jumbf:all= -overwrite_original "$f"
       
        # Set Finder color tag to Grey
        osascript -e "tell application \"Finder\" to set label index of (POSIX file \"$f\" as alias) to 7"
    fi
done

Much appreciate your help

forgot to add, it also works fine when run directly from termial on M2 Mac

Phil Harvey

How are you running this script?  It should work if run directly from the terminal since you say that exiftool works this way.  If you run it some other way the process could have a different group/owner.

What output does the script give?  ExifTool should tell you how many files were changed if it ran.  Otherwise there is a permission problem running /usr/local/bin/exiftool.  Make sure it is executable by whatever user is running the script.  Also, the directory containing the images and the images themselves must be writable by this user.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

MHut

Thanks for comming back to me so quick Phil.

Sorry, I should have mention earlier - Im running the script via finder quick action.

Indeed the issue was how I've installed exiftool on the M2 machine (via homebrew) so the correct path for it was:
/opt/homebrew/bin/exiftool