Here's the final update:
Your disclaimer was spot on. The first thing I did, was to expect "mv" in an automator process to start in a given folder. Well it starts in home folder, as I later learned. The script worked and it nicely renamed all the files and folders in my /home. Lesson learned.
From here on everthing worked like a charm.
This is the final code.
for f in "$@"
do
FILEBASE=$(basename "$f")
FOLDERBASE=$(dirname "$f")
SHORTNAME=20${FILEBASE:14:2}${FILEBASE:10:2}${FILEBASE:6:2}${FILEBASE:16:3}${FILEBASE:20:2}${FILEBASE:23:2}
NEWNAME=$FOLDERBASE"/"$SHORTNAME
mv "$f" "$NEWNAME".mov
done
The problem with movies files on iPhone is, that they are a headache to organize. Timestamp in EXIF is wrong (don't really know why), only the filename is correct.
Video 10. 02. 13 17 42 11.mov
The problem is, that I have my pictures organized as YYYYMMDD HHMMSS. Therfor I needed this script to match the names of the movies.
This is the final result:
Renaming the images via the EXIF timestamp:
Renaming the movies by truncating the filename to match:
Result:
Took quite so time, but I've learned a lot in the process. Coming from Windows I must say that it is astonishing what an average user can accomplish in terms of modifying the UI to his needs with relatively little effort.
Thanks for all the help!