Update Sequential Number

Hi guys,

In "Rename" there is a feature "Sequential Numbering From" to add a counter to the filename.

Is there a possibility to "update" this counter for use in coming rename-sessions?

e.g.:
The first time the counter = 0; 6 files are selected: the rename puts 0 to 5 to the files;
(Now I would like that the counter is updated to 6 for use in future sessions...)
..
next time:
5 files are selected; I would like to number them from 6 to 10. Now I have to update the startnumber manually.

Thanks in advance!
Rien

What would happen if you ever needed to rename a second, parallel sequence of files? Having just one stored number probably wouldn't work that well.

Are the files all in the same folder in the end, or do you need files in different places to maintain a sequence number? Any reason not to use the date instead?

Hi Leo,

Thanks for your response! You're right: why shouldn't I use a date instead of a sequential number? It's a peace of history: in the past they decided to use a sequential number... every day I receive files: sometimes 1; sometimes 100. For archiving and checking they want to do as described.....

But no worries: if DO can't do it: that's fine for me. I only wanted to check if I oversaw a feature to do it.

Thank you!

A script could fairly easily work out what the current number in the folder was up to and then launch Rename with the appropriate value.

Hi Jon,

Yes, I could try that. Could you pleas tell me the name of the property that controls the value of "Sequential numbering from"?

Thank you!

If all the files are in the same folder (that's why I asked earlier), you could use the approach in this script:

You'll need to modify it slightly, but not much. That script avoids using duplicate numbers, but will use a number lower than the current maximum if there's a gap (e.g. due to an old file being moved or deleted). But it should be fairly easy to make it always use the next highest number.

Hi Leo, Jon,

Great! Thanks a lot. I will modify the script.

Cheers,
Rien

You could define a global variable...

function OnClick(clickData) {
    DOpus.Vars.Set('eternalCounter') = 123;
}

... and use it in a Rename Script:

function OnGetNewName(getNewNameData) {
    var tmpStem = getNewNameData.newname_stem;
    var tmpExt = getNewNameData.newname_ext;
    var eC= DOpus.Vars.Get('eternalCounter');
    tmpStem += ' ' + eC;
    DOpus.Vars.Set('eternalCounter') = eC + 1
    return tmpStem + tmpExt;
}

Set eternalCounter.dcf (435 Bytes)
Append eternalCounter.orp (546 Bytes)

That works as long as you never use the script in the Rename dialog (with the preview turned on), since generating the preview will bump the variable the same as doing the rename for real.

(I think both this method and mine also don't prevent skipped numbers if a file fails to rename for some reason. That's harder to solve, but can be done if needed. Actually, not hard to solve, but hard to solve without a lot of extra disk access to check what's in the folder before renaming each file.)

Thank you both!

I will experiment with it tomorrow.