How can I remove leading/trailing whitespace from filenames in Automator? My wife tediously renames files all the time when storing on her backup external storage, so I investigated using automator to do this for her. I now have an automator folder where she just drops the file in there and it will rename the file appropriately.

I'm now faced with a situation where the file may now contain leading and/or trailing whitespace, how might I simply trim this whitespace?

I've never really used AppleScript but am proficient in shell scripting, can I simply write a shell script that will perform this task? I will give AppleScript a go if someone could point me in the right direction.
There's one line script for that, cd to that folder and ...  

for f in *; do mv "$f" "$(echo $f)"; done


Put it into a shell script and call it from Applescript:

tell application "Terminal"
    do script "whatever"
end tell