How to set the starting number in to a dialog box in file rename

I have a button with this code

@filesonly
Rename NUMBER=1 REGEXP PATTERN="^(.*)(\.[^.]+)$" TO="{dlgstring|Enter Album name}{dlgstring|Enter Artist name|. Artist. } ([#])\2"
@nodeselect 

What does the button does?
This button Rename The selected files and the Name comes from a input dialog box
and put a incrementing number at the last of the file name.
The number start from value 1
But I want to set another dialog box where I input the Starting number.
If I input The Number value 5
Then The Selected Files will be renamed and starting number will be 5 then 6 then7 then so on
Example:
If the selected file name is
Scan_21-01-2021_2002
Scan_21-01-2021_2007
Scan_21-01-2021_2009
Scan_21-01-2021_2015
Scan_21-01-2021_2017
and I input the name into the rename Dialog box Khalid
then the second dialog box I input Hossain
then the Starting number dialog box should appear and I input the starting number is 5
Then OK. Then the files are rename in
Khalid Hossain (5)
Khalid Hossain (6)
Khalid Hossain (7)
Khalid Hossain (8)
Khalid Hossain (9)
Khalid Hossain (10)
How to do it?

You've using NUMBER=1 and the number starts at 1.

You want the number to start at 5 instead of 1.

C'mon, you can work this out yourself. :slight_smile:

1 Like
@filesonly
Rename NUMBER={start}{dlgstring|Insert Starting Number} REGEXP PATTERN="^(.*)(\.[^.]+)$" TO="{dlgstring|Enter Album name}{dlgstring|Enter Artist name|. Artist. } ([#])\2"
@nodeselect 

Finally I got This code worked. Is That OK? or is there more simple way?

You probably don't want {start} in there but the rest looks OK.

@filesonly
Rename NUMBER={dlgstring|Insert Starting Number} REGEXP PATTERN="^(.*)(\.[^.]+)$" TO="{dlgstring|Enter Album name}{dlgstring|Enter Artist name|. Artist. } ([#])\2"
@nodeselect 

Yes actually This code works without {start}, Thanks Leo.

1 Like