Renaming Photos via shooting time

Hello,
I have a problem with renaming my photos.
Here is an example of a filelist.

Name Shooting Date

IMG_0105.JPG __ 04.02.2012
IMG_0106.JPG __ 04.02.2012
IMG_3204.JPG __ 05.02.2012
IMG_3205.JPG __ 05.02.2012
IMG_3206.JPG __ 05.02.2012
IMG_3215.JPG __ 06.02.2012
IMG_3218.JPG __ 06.02.2012
IMG_3226.JPG __ 06.02.2012
IMG_3228.JPG __ 06.02.2012

I use the following regular expression

Old name: (.).(.)
New name: {shootingtime|D#yyMMdd}-[#].\2

and get this filelist:

Name Shooting Date

120204-001.JPG __ 04.02.2012
120204-002.JPG __ 04.02.2012
120205-003.JPG __ 05.02.2012
120205-004.JPG __ 05.02.2012
120205-005.JPG __ 05.02.2012
120206-006.JPG __ 06.02.2012
120206-007.JPG __ 06.02.2012
120206-008.JPG __ 06.02.2012
120206-009.JPG __ 06.02.2012

But what I want to have is a file list like the following, because I want to handle long file lists with different date of the shooting time suddenly.
The numbers of the photos should begin with ...-001 for every new shooting date in the list.

Name Shooting Date

120204-001.JPG __ 04.02.2012
120204-002.JPG __ 04.02.2012
120205-001.JPG __ 05.02.2012
120205-002.JPG __ 05.02.2012
120205-003.JPG __ 05.02.2012
120206-001.JPG __ 06.02.2012
120206-002.JPG __ 06.02.2012
120206-003.JPG __ 06.02.2012
120206-004.JPG __ 06.02.2012

How can I do this? Please help. Hope you understand my problem.

I can give you a quick trick to perform the task in two operations.

The first step involves not adding a sequence number, but instead renaming the files using Dopus' auto-rename if file exists setting. The trick here is to place a (1) at the end of every file so that Dopus will name the second, third, etc. files as: ... (2), ... (3), etc. This gives you the numbering.

The next step is to remove the parens.

So, the first rename settings will be:

Type: Regular Expression
Automatically rename if new file exists:
Old Name: (.)(..)
New Name: {shootingtime|D#yyMMdd} (1)\2

The second will require a script to add the numeric padding. Change nPad to the desired number of padding places you want (it is set to 3 below);

Old Name: (.) ((\d+))(..)
New Name: \1###\2###\3
Type: Regular Expression
Script Mode, with the following script:

@script jscript

var nPad = 3;
var fillChar = 0;

function pad(toPad, padChar, length){
return (String(toPad).length < length)
? new Array(length - String(toPad).length + 1).join(padChar) + String(toPad)
: toPad;
}

function Rename::GetNewName2 ( strFileName, strFilePath, fIsFolder, strOldName, strNewName )
{
a = strNewName.split(/###/);
return a[0] + "
" + pad(a[1], fillChar, nPad) + a[2];
}

Create two Rename presets, saving the settings for each as given above. Then run the first, then the second.

Thank you very much for your answer. Sorry for my late reply, I had so much to do.
Your suggested trick sounds very good. But I tried your first step and copied your code into the lines of the rename dialog, marked the auto rename option if new name exist. But I got an syntax error. In the prewiew field all the files have the same name. It is "{shootingtime|D#yyMMdd} (1).jpg".
What do I wrong?
Thanks again!
Holger

You've probably got Enable file information fields turned off in the Rename window.

Leo, thank you very much, I really forgot to enable it!
Holger

Hello MrC and Leo,
thank you very much for your help. It works perfectly for me.
Holger