Unelegant mass renaming from a script

I would like to improve the following situation:

In a script I have a list of hundreds of files that need renaming. Neither the old nor the new names follow any obvious, regular pattern, so I use a lookup table. Currently I add one RENAME line per file to my command and then run it. That works - but is there a faster/more elegant way?

Is it possible to combine a RENAME command run by a script with a traditional Rename Script, ie. a function like OnGetNewName() that is called for every file and could perform the lookup? Would that even be faster?

Also, is there a way to abort a command without using the progress dialog? Something like cmd.Abort()? My script has its own UI and I have disabled the automatic progress dialog by setting noprogress.

Are you finding it particularly slow? If not, I wouldn't worry about it or spend time trying to speed it up if it already works.

Well, it takes a few seconds, which isn't really an issue. I just always try to optimize and elegantize :wink: .

Most of that time is probably just the renaming itself, which can't be avoided. :smiley:

1 Like