I'm writing a simple Automator script to convert WAV and AIF files to MP3 using the LAME encoder.
After passing the file, I run this shell script:
The whole part after "echo" effectively replaces the previous file extention with ".mp3". Works great, except it can't handle files or folder paths with spaces. I assume this is a quick fix involving quotes of some kindany help is much appreciated.
(BTW, if there's an easier method of replacing file extensions, I'm all for it.)
After passing the file, I run this shell script:
Code:
/usr/local/bin/lame --preset insane $@ $(echo $@ | 'sed s/\.[^.]*$/.mp3/')
The whole part after "echo" effectively replaces the previous file extention with ".mp3". Works great, except it can't handle files or folder paths with spaces. I assume this is a quick fix involving quotes of some kindany help is much appreciated.
(BTW, if there's an easier method of replacing file extensions, I'm all for it.)
Last edited: