Automator - File rename script
Hello,
I'm trying to create a script that will rename files using a .csv file.
Here are the steps in Automator:
Here's the Shell Script (I got it from Tony T1)
cd "$1"
while read line
do
OldImageName=${line%,*}
NewImageName=${line#*,}
if [ -e "$OldImageName" ] ; then
mv "$OldImageName" "$NewImageName"
else
echo "$OldImageName" >> ~/Desktop/Errors.txt
fi
done <"$2"
It runs well in Automator but for some reason the file names don't change.
Any help would be greatly appreciated :)