It would be even better if there could be code to automatically do this after manually selecting the files in question. For example
edit "filename" ctrl U
onto a toolbar button and all you do is select the files and click the button. The only problem here is I don't know how this would work if you select multiple files.
I would love to see the proper syntax for such a custom button for this action.
Have a look at the syntax for the Rename command. It already includes a case argument which allows things like (which work fine with multiple files selected):