Newbie question: script - how to get both new and old name box blanc

Hardly dare to ask...
Have been trying to create a simple rename script.
Basically it works except for one thing.

Say, I select 5 files then when running the script, it will fill -both- 'Old Name' and 'New Name' boxes
with the 1st file of the list and do the rename on that file only.

When I manually blank those boxes, then all files are renamed correctly.
(There are no script errors)

Maybe it has something to do with the starting lines?

=

[code]Option Explicit

Function Rename_GetNewName ( strFileName, strFilePath, _
fIsFolder, strOldName, ByRef strNewName )[/code]

the if-endif stuff reads as follows

=

If (re37.Test(strFileName)) Then strNewName = re37.Replace(strFileName, "$1-01-01-$3") ElseIf (re39.Test(strFileName)) Then strNewName = re39.Replace(strFileName, "$1-01-02-$3")
etc..

How to get the script running without filling the old and new boxes with the first file of the list?

Thanks

=

Put * as the old and new names, and re-save the rename preset.

Ahum . . . :blush:
Thanks a lot!

=

Later ..
I see, in the 'old' scripts the lines:

'
Rename PATTERN="" TO=""
@script vbscript
Option Explicit
'
were 'extra' before 'Option Explicit'

probably need to add the first line in future.

=

That's an old way of running a rename script inside a button, without making saving the script into a separate rename preset.

It was often used to do things that had nothing to do with Rename but used Rename as a way to run scripts. (Before we had scripting support everywhere.)

It's still useful in some situations, but only rarely the best way to do things these days.