# Rename to 'file' of 'total files'

**URL:** https://resource.dopus.com/t/rename-to-file-of-total-files/20634
**Category:** Help & Support
**Created:** [May 22, 2015, 4:38am UTC](https://resource.dopus.com/t/rename-to-file-of-total-files/20634 "2015-05-22T04:38:56Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![tbone](https://resource.dopus.com/user_avatar/resource.dopus.com/tbone/32/25726_2.png) [@tbone](https://resource.dopus.com/u/tbone)
#### Post date: [May 22, 2015, 11:51am UTC](https://resource.dopus.com/t/rename-to-file-of-total-files/20634/4 "2015-05-22T11:51:28Z")

</div>

I once did a very specific rename prototype of script to pick up on the numbering a set of files already has (and if not start at 1) and use the first selected file to fetch the filename for all other selected files. It is a bit difficult to explain and I also wasn't very creative finding a name for the script command. That thing and some background info, usage descriptions can be found here.

> [@Renaming - Multi File Renaming Questions](https://resource.dopus.com/t/renaming-multi-file-renaming-questions/18668/8):
>
> This is to get you started and maybe even more interested in this scripting-thing sooner or later, who knows? o) I've attached a jscript file, remove the txt-extension and drag it over to the preferences-\>toolbars-\>scripts section - a new user defin…

Now I had a quick look at it again and by tweaking two lines it seems this modded version below, get's quite close. But you cannot really customize the pattern used for the final names without editing the code. I thought, maybe you can live with that or let's have that for further discussion.

Just select a bunch of files and run "RenameBaseNameContinueNumbering" from button or command field.

Here it goes:  
[Command.File\_RenameBaseNameContinueNumbering.js.txt](https://resource.dopus.com/uploads/default/original/3X/6/3/6365bb69b86c02b52d724b02bb26cd80d5be0d3a.txt) (3.97 KB)

ps: You need to enable the script command first and also try with no number in your filenames, could end up in better result.

---

_[View the full topic](https://resource.dopus.com/t/rename-to-file-of-total-files/20634)._
