Select newly created file name, then select it again when it appears again

This (convoluted) question is related to a patch creation program called RTPatch, which I use to create software patches. RTPatch is extremely fast when it comes to comparing the differences between "original files" and "patched files", and the patch files it creates are much, much smaller than those created by other patch-making software I've used - The TL;DR is this: Make Directory Opus auto-select a specific file when entering a folder, then auto-select a file that gets created (named PATCH.RTP) in that folder (which is then renamed to something else), then auto-select that same file again when it is created a second time. The comparison module (patchbld.exe) creates the differences file with the default name of PATCH.RTP.

  1. I have a folder named C:\RTPatch - whenever I enter that folder, Directory Opus automatically selects a file called "MakeRTP (BEFORE :arrow_forward: AFTER).exe" - When this is run, it runs a comparison program which compares files in folders D:\BEFORE and D:\AFTER, then creates a file named PATCH.RTP (this file is created in the C:\RTPatch folder). The newly created PATCH.RTP file contains the differences between the files in the D:\BEFORE and D:\AFTER folders.

  2. I want Directory Opus to automatically select the PATCH.RTP file when it is created. I then rename the PATCH.RTP, then execute another file called "UnRTP (AFTER :arrow_forward: BEFORE).exe" which does the same thing as the "MakeRTP (BEFORE :arrow_forward: AFTER).exe" except it does the comparison in reverse: this creates another PATCH.RTP file, but this file lets me reverse the changes made by the first PATCH.RTP file.

Is there a way to make Directory Opus automatically select the PATCH.RTP file whenever it sees that it has been created? Don't waste too much time answering my question, I'm just curious if it is possible to do this. Thank you.

You could have a script which runs the patch generator and then selects the file when it is finished. That would be the easiest way.

What do you do with the file after selecting it? The script may be able to do that action instead of just selecting the file for you.

@Leo:

Apologies for not getting back to you sooner, I have been quite busy.

You could have a script which runs the patch generator

Actually, the patch generator is actually a .bat batch file that has been converted to a self executing .EXE file (using BAT-to-EXE Converter)

What do you do with the file after selecting it?

The first instance of the created PATCH.RTP file is renamed to something like "BEFORE changes were made.RTP" - The second instance of the created PATCH.RTP file contains the comparison results, but reversed, and is renamed "AFTER changes were made.RTP" - I resource-edit a lot of software (to make them more usable), and the patches let me save my modifications in steps, and if necessary, use the reverse-modification patches to undo my changes if something goes wrong. I only create the patches so I will be able to modify a program again at a later time, without having to do all of the modifications from scratch should I have to re-install it later (like after re-installing Windows). I use RTPatch for generating patches as it is the fastest patch maker that I've ever used (I've tried out a lot), and the patch files it creates are the smallest out of those created by other patch makers. Patch creation is dead simple since I can create patches using only 2 batch files (BEFORE and AFTER).

Unfortunately, I don't have any experience writing scripts that select files automatically, other than a script like:

C:\Program Files\GPSoftware\Directory Opus :: dopus.exe

which automatically selects the dopus.exe file when I enter the C:\Program Files\GPSoftware\Directory Opus folder. I think you taught me that, IIRC...

It doesn't really matter what it is, as long as you can run it and it does not return until it has finished.

If you can do that, then you can make a button which runs it, waits for it to finish, then selects the files. That is easier than having something which will always be looking for the files on the off chance they appear.