Recursive file selection inside app own dialog

Hi guys,

I’m new to RPA and am trying to implement a solution that may be simple. The use case is: I have an upload windows application and I need to recursively iterate throug a tree of folders, uploading all files available and moving the uploaded ones to a mirror folder structure (created on the fly).
The aplication opens a select file dialog in which I must select at most 100 files at each time. After that, I need to click the Upload button and wait till the upload ends (progressbar) to start a new batch with the next 100 files.
At the end of the whole process the expected result is to have all files uploaded and all the original files moved to a mirror folder structure under a “DONE” folder.
Any directions on how to achieve this would be appreciated.
Thanks!

Hi @iFelinto,
Welcome to the Community!
Apart from navigating through the folder structure which might be a harder case, you can use the Send Hotkey activity with the CTRL+A combination to select all files inside the folder.

Are these folders and files structured with any logic? How does it look like? Maybe it will be easier to figure out any solution.

Hi @Pablito,

The folders structure has no order at all. I’ll also have to find a way to retrieve the folder name (only the last one in the path) to paste it into a field after the file selection.
I won’t be able to use the CTRL+A as I must select at most 100 files each time.

Thanks for the contribution.

The only thing that comes to my mind is listing files and the last folder name using a PowerShell script. Then you could push it to excel or the datatable variable and work on this using loops.

This will list all files inside each folder in the mentioned path:

Get-ChildItem -Path “<folder>” -Recurse

This can list first 100 elements from the path:

Get-ChildItem -Path “<folder>” -File | Select-Object -first 100

The problem here is that I’m not using the Windows Explorer to select the files, but the File Selection Dialog of the application…

Is there any way that you could add files one by one?

That would increment the processing time a lot… not desirable. Is there a way to check if an image is at a specific position at the screen? Something like: If is at coord x,y?

Not in any official package but you may try to check Marketplace for any custom package.

Thanks, I’ll look into it later. We were able to implement it using another tool (Macrorecorder). The image identification feature was fundamental.

Hmmm, I would like to see it. We have some image recognition mechanisms as well. On the other hand there is always a way for improvement. Could you share some details about this Macrorecorder and how you are achieving the solution with it?

Here is a screen of the feature:

image

1 Like

I’ve created two scripts on macrorecorder. One to open and select the first x files in the window (Could not attach files as I’m a new user).

1 Like

and another one that creates the loops:

In resume:

  1. Open the selection dialog screen;
  2. Change the view to “Details” (in case another view type by icons is selected);
  3. Click on the first file position. Checks if it is a folder (image). if it is loop until it is not a folder;
  4. Copy the folder path to Clipboard;
  5. Select the first X files;
  6. Open the metadata editor and paste the folder path on a field;
  7. Close metadata editor;
  8. Upload files;
  9. Open the selection dialog screen and reselect the same group of files;
  10. Delete them (backup before macro starts, of course);
  11. Checks if folder is empty (blank image);
  12. If not, repeat;
  13. if empty, up one level, delete folder;
  14. Check if final folder (zzz UPLOADER); If not, restart;
1 Like

Thank you very much for this! I will share it with the team. It is definitely something worth exploring. I will keep you in the loop in terms of any information if you don’t mind :slight_smile:

Sure, thanks for that.

1 Like

Small update :slight_smile:
I pushed the information from you to our internal tracker. It means that our team will take a closer look at this and it might become a new feature someday. I wrote “someday” because it’s a quite long process but on the other hand I would like you to know that every feedback matters to us. Thank you!