A very different need for a filename

I have filenames that I cannot afford to lose. I know how to capture all the names within a directory but my problem is more than this. I need to replace this valuable filename with another name that is also very critical. If I could give a file two different filenames and when I need to use them I would be able to quickly obtain, this would be a fabulous conclusion.

I guess it would be like given a boat and airplane the same name and expecting each to fly. So here is what I would like to do. And use hotkeys to accomplish if possible. Since I have 4000 records to complete speed is essential. On my next batch I will be typing the file name onto the document as I scan and will not have to worry about this problem. But for now I have an issue.

  1. Save the current filename as a description or whatever is possible.
  2. Just as fast as I save that file name I would like to be able to apply a new file name, type five characters, that would be the displayed filename.

As improbable as this seems to me I would not be surprised to find an answer for my issue. Over the past several months I have been using Opus to reestablish my company in ways other software couldn't start to help. it turns out to be the only solution I have two purify my 24 years of data.

Bob Snow

You can use this in a button to place the existing filename into a comment, and it will then open a dialog asking for the new name for the file, and rename the file (leaving the suffix unmodified).

dopusrt /cmd SetAttr FILE {file} META comment:{file}
Rename PATTERN ..([^.])$ TO "{dlgstring}.\1" REGEXP

Yes, this does work very well. as it is, I can keep on going, but I was wondering if I could make a slight change.

For the filename I'm answering:
six characters
A date using zeros are whatever's the easiest method.
5 Characters
7 characters


123456 Record Number
05-02-13 Record Date
12345 Record location
1234567 Record Created by

Since all values are total, no short values, it's easy to search for values.
Example "Record created by" will always start at position 16 to the end, etc.
I hope I don't seem ungrateful for what you've given me, but I have no knowledge of REG and it seems like a dynamite way of getting it done. This is beyond what I was hoping for, but it sure would make my job easy. the reason I'm using the 05 02, date, is so I don't end up with an odd number of values.


I'm happy to help, but I'm not sure I understand exactly what you want. Can you indicate what you want to enter into the dialog box, and exactly how you want the filename formatted?

The actual file is images or documents. The documents contain several key elements that I want to include in the filename. If the file name contains all the values in the same order, within the filename, I will have the ability to search all the documents. By looking at the image using Opus viewer pane. I can see all the needed values. At this point I just type them as a filename. When I do my search It will be based on the value from point "A" to point "B". One example would be the date: my search, which start at point "A", position 7 to "B" position 14. I can do a similar search for any of the 4 values.

231432 ID
02-15-13 Date
13251 Location
251 Created by.

Filename: 23143202-15-1313251251

The last value "Created By" can have a value from 2 to 7 characters. Since it's the last value. The number of characters does not matter in the search. I just search from position 20 to the end.
Example: If I needed to search for who "Created" the document, I would search for any value from the 20th position to the end. So if their number was 251 , I would still get a valid search. As long as I start at the 20th position. So all searches are based on everything being in the right location and being of the right size, with the exception of the last value, which starts from position 20 to end.

So the values of the filenames reflects the critical values within the image.


Actually, the more I think of it. The only issue with this name is the date. All the other values are controlled by me put it in the right amount of numbers. So when I put in my six digits and then if it knows that the next values the date everything up else will fall in place.

I'm understanding that you want to enter all the values except the date, which should be the current date (please correct me if I'm misunderstanding). Here's a change that presents 3 dialog boxes, asking for the ID, Location, and Created By. It formats those as you want, including the current date, and renames the files based on your input.

dopusrt /cmd SetAttr FILE {file} META comment:{file}
@set id {dlgstring|Enter id}
@set location {dlgstring|Enter location}
@set createdby {dlgstring|Enter createdby}
Rename PATTERN ..([^.])$ TO "{$id}{date|MM-dd-yyyy}{$location}{$createdby}.\1" REGEXP

I'm going to try the above code after I send you this quick response.

I found that if I put the date first I can use such things as 1613 and get 01/06/2013. I also decided to put spaces between values for a quick check. And since everything is the same size with the exception of the last value. This also helps for a quick check.

numeric six characters
numeric five characters
numeric three to seven characters

I was also thinking maybe it would work better to have the file to comment as they separate part. That which can run it first and then with time permitting finished the renaming in due course. I started to think about that, after I had remembered how I was able to capture the names of every file in my directory and add them to a text file in less than 10 seconds and I'm talking 4000+ filenames. I found the code to do this on the Internet and thought it would be a good idea to share it with you. You never know when a day will come.

windows7themes.net/how-to-copy-f ... -text.html

Now to see what we have.

I just tried out the code. I'm not sure it doesn't seem like it's been saved. Entry box stays on the screen and when I clicked on it. I thought it was going to go to the next record, but the action doesn't seem quite right. And then after the second from the last value a space would help so I can see the last value more easily.

When I go to see the files that I've done. I do not see them in the director. But I do see a lot of folders, newly created, based on the month. it seems like the code might be adding them to these directories or possibly something I did in the settings is changed by my Opus settings. Either way this is something I had not even thought of, but it's definitely an excellent idea.

Online. It looks good. At the end would help. And it might have a glitch when it comes to saving or dropping to the next record, something.

The function only works on a single file, the first one selected. Since you are using the preview window to obtain the information you want entered, I don't know how to have DOpus move the previewed file to the next one in the list of selected files so that you can view its information, etc. So, the current limitation is a single file.

I think you're going to have to decide first what you want your file name format to look like and how you want to do the job. Otherwise, there is too much thrashing with changes.

Where is the date coming from ? Is that something you enter, or can it be automatically grabbed from the system or current file name? In any case, if you are entering it, you're going to need to enter full month and day values, as otherwise, you run into problems. For example, what is:


Is that 11 / 1 or 1 / 11 ?

I'm surely not using the full deck. What I thought was a good feature, ending up in folders by date, does not work as well as I thought. The first thing I enter is the date:
1/1/13 - I have to type 010113 (That's because the day value is less than five)
1/6/13 - I have to type1613 (That's because the day value is greater than five)
At least it seems to work that way and I believe I had read about this in Dopus somewhere.

After I enter the date I and up getting a space when I start to type in the next six digit value.
423143 (Unfortunately I don't get the space after this value - but I just simply get the space bar.)
53214 (I then type in this five character value and again hit the space value.)
782---- (Here I type in a 3 to 7 digit value and also add any comments since it's the end of the filename.

The problem that confuses me is that when I hit the down arrow to go to the next file . The file gets saved into a directory based on the date that I applied. If there is no directory it will create one. So if the date is as following:
04/14/2013 with a file name of:
04/14/2013 423143 53214 782---- When I get the down arrow, save the document, the actual filename is changed to

Sorry - talk about hitting the down arrow to fast and saving!!

04/14/2013 423143 53214 782---- When I hit the down arrow, save the document, the actual filename is changed to:
04/14/2013 423143 53214 782---- excluding the month and the day and also the "/" that is shown as I type in the name (Knowing this is not an accepted value, I was wondering about that)

And the above file ends up in the directory 01\14. I would prefer to have all the files stay within the working directory.

so when all is said and done, I would like to end up with the following:
04142013 423143 53214 782---- (782 being the end of the file name might have additional notes)

I'm really sorry about the confusion and I do appreciate your help. If I can get this working it will give me the ability to get help. Because then I'd be more reassured that things are being applied as needed for my searchers.


SideBar: I did restart my computer to find out what is affecting the date as far as how it appears, how it is saved & where it is saved.

I just tried the date part of the filename on the another computer and it could not accept it. Since I restarted Opus and i still get the action on the date, there seems to be something left over from using the bottom. Some thing you would expect from the registry or possibly even some internal dOpus settings. I don't have a clue. But I do know the date is only affected on the computer that I worked with the code.

Now I think I understand one part of it. 04/05/2013. The "/" is what is creating the directory's. And since 2013 comes after "/" it is what starts the filename. So if with this is the case, and I cannot get the date to accept a value of 01122013 when typed as 12313 I must be happy with typing 01122013 or 011213. it might be that I'm expecting too much magic for this filename. And simply hitting the space bar for spacing might not be all that bad.

But if IA was able to type in the filename as: 01/12/2013 425156 13251 724 But it saved, in same directory, 01122013 425156 13251 724 that would be good. Seeing it as, before the save, 01/12/2013 425156 13251 724 gives me a fast check glance.


PS I was also wondering how this code can still be affecting my entry of the date value. Truly, the date goes in very perfectly. It's just what happens after a save.

You can't use / or \ in your dates, since those are illegal filesystem characters. Most folks use dash instead, or no separator at all. Examples:


Try the function below. Enter your date an one of the formats above (or however you'd like, so long as it does not contain / or \ or other illegal filesystem characters):

dopusrt /cmd SetAttr FILE {file} META comment:{file}
@set mydate {dlgstring|Enter date (mm-dd-yyyy)}
@set id {dlgstring|Enter id}
@set location {dlgstring|Enter location}
@set createdby {dlgstring|Enter createdby}
Rename PATTERN ..([^.])$ TO "{$mydate} {$id} {$location} {$createdby}.\1" REGEXP

This should give you the idea of how you can enter the data you want. Alternatively, you might find it easier to just enter everything using a single dialog. It should be obvious from the code how to make these changes, but if not, ask.

I was able to put things together and make it work. Thank you very much for the amount of time that you put into this to help me.



The solution I gave may not work correctly. Leo points out in this thread that the rename may occur before the comment is set with the old name. It doesn't appear there is a real solution to ensure this doesn't happen.

You sure can't save we did give it a try. Thanks for the help.