I'm trying to write automation service that gets all images exclude .jpg from the current directory (or selected files), convert them to .jpg by imagemagick mogrify and delete old images.
script: mogrify -format jpg *.* && find . -type f ! -name "*.jpg" -delete
I've tried my script in the terminal and it works fine.
Then, I've created automator service for doing the same thing from context menu and I'm stacked.
It make error
The action “Run Shell Script” encountered an error: “zsh:1: command not found: mogrify”
UPD.
Thanks to Mark Setchell, /opt/homebrew/bin/magick
works fine, but i'm still having errors that you can see below. Looks like the script executing in the incorrect folder.
UPD2.
I fixed it by passing input as argument and using this argument (folder) for changing directory before script