Automator fail with ffmpeg bash line I want to batch convert .m4a music from iTunes to a flash drive as .mp3
This bash script... (source https://ubuntuforums.org/showthread.php?t=1614765)

for f in *.m4a; do ffmpeg -i "$f" -acodec libmp3lame -ab 256k "${f%.m4a}.mp3"; done



...achieves this, but I'll like use set up an Automator Folder Action to do this for me. 

AFAIK, the automator in this screen shot should work but does not.

I'd read some stuff - which I didn't really understand - about "$f" needing to be in quotes, but it already is. 



Any advice, please?
Automator supplies arguments (file names) to the shell script.
Try:

for f in "$@"
do
    case $f in
        *.m4a)
             /absolute/path/to/ffmpeg -i "$f" -acodec libmp3lame -ab 256k "${f%.m4a}.mp3"
             ;;
    esac
done