Rename and Delete Button

I have been using Dopus to maximize the efficiency of my document filing. A lot of the manipulations center around a file called "11.pdf" in my document folder. Now, I have a new Fujitsu scanner that automatically names the new scanned file to "11_001.pdf", if "11.pdf" already exist. That mechanism adds a lot more mouse clicks for my day to day file operations.

I have been searching for hours, but still aren't quite sure how to get around this. I got this far;

Copy "c:/users/ed/Documents/11_001.pdf" AS="11.pdf" TO="c:/users/ed/Documents" WHENEXISTS=replace
Delete "c:/users/ed/Documents/11_001.pdf"

But, I need to somehow to stop the error prompts if the file is not there

  • If "c:/users/ed/Documents/11_001.pdf" doesn't even exist, don't give me an error prompt. Just go silent, and do not continue the Delete command.

Should I use the RENAME, or Is this something that can done with some switch or I need to look into scripts?

You could test with @ifexists and move or rename the file:

@ifexists:"c:/users/ed/Documents/11_001.pdf"
Copy MOVE HERE "c:/users/ed/Documents/11_001.pdf" AS="11.pdf" WHENEXISTS=replace
@ifexists:"c:/users/ed/Documents/11_001.pdf"
Rename FROM="c:/users/ed/Documents/11_001.pdf" TO="11.pdf" WHENEXISTS=delete

With the Copy version, I recommend TO="c:/users/ed/Documents" instead of HERE if the aim is to keep the file in the documents folder.

@ifexists:"c:/users/ed/Documents/11_001.pdf"
Copy MOVE "c:/users/ed/Documents/11_001.pdf" TO="c:/users/ed/Documents" AS="11.pdf" WHENEXISTS=replace

(HERE should mean the lister's current directory, but its behavior when a full path is specified is in flux at the moment. In the long term, we're aiming to make the combination of HERE and a full path copy the file to the lister's directory, not the directory where the file is coming from. The current beta has a change to that effect but it caused some other problems, so we're going to back it out in the next beta, and do more internal testing before changing it again. It probably will change in the future, though, so the combination is best avoided for now.)

The Rename version looks perfect as-is.

1 Like

Thanks for the help, I appreciate the quick response. I might still be missing something.

I put the the codes inside a button.

With my original codes

  • Dopus does the rename and delete, although with some extra undesired prompt
  • and it won't work if the pre-conditions are changed
  • But, at least it does something

I tried both Leo and Ixp's codes

  • Dopus does not do anything, no response at all

I suspect something to due with the "@ifexists:" thing. Does that code need to be somewhere? Scripts or something?

Thanks.

It goes into the same place as the rest. It should look like this:

(If you only see a single-line command field, click the Advanced button at the bottom of the dialog.)

Leo,

I tried different combination tests.

If I got the following code, Dopus will not response at all, no error message, just nothing.
@ifexists:"c:/users/ed/Documents/11_001.pdf"
Rename FROM="c:/users/ed/Documents/11_001.pdf" TO="11.pdf" WHENEXISTS=delete

If I remove the line @ifexists:"c:/users/ed/Documents/11_001.pdf", with just;
Rename FROM="c:/users/ed/Documents/11_001.pdf" TO="11.pdf" WHENEXISTS=delete

then it will do the rename provided 11_001.pdf is there.

So, Dopus is not interpreting the line "@ifexists:"c:/users/ed/Documents/11_001.pdf".

Looks like quotes " should not be used with the @ifexists modifier - just remove them.

1 Like

We'll make quotes OK there in the future to make life less complicated.

Leo / Ixp,

Removing the quotes make it work perfectly. That saves me so much time in my work. Thanks again.

1 Like