It is really not a good idea to go through an unknown number of files in a timed manner, 3 seconds is a long time per file! It will forever for big folders and requires
constant attention. What if the phone rings in the middle of the operation?
This is not a video game!
I suggest something as in the attached example.
(1) read all files into a listbox.
(2) let the user select 0, some, or all files.
(3) pressing save writes all selected files in one step.
Note that I put the actual "save" operation into a case for debugging. Instead, It only displays what it would write to file. Just change the boolean for the case if you actually want to save to file.
Happy wiring!