how could i open an image in a folder then take some information from that image then close the image, choose another image in same folder and do the same thing
I have used below process to open all files from a folder. Please check below and let me know if any queries.
i can’t find “for each file in folder” or “for each file” in my activities
You can find For Each file in folder loop in Snippets. Beside Activity, you can find Snippets. Check loops in Snippets. Let me know if you can’t find Snippets, I will share image.
You can’t set the location with Select folder activity. It will open browse option when you run it to select folder. Selected folder property will let you know which folder is selected.
You could get the filelist with Directory.GetFiles(string path, string searchPattern) - it supports * and ? wildcards:
string() pdfList = Directory.GetFIles(“D:\myFolder”, “Weekly Macro Report*.pdf”)
and then iterate with For/Foreach loop where you will have the ReadPDF activity.
Remove select folder activity and in below Assign activity replace selectFolder in Directory.GetFiles(selectFolder) with folder path. It works for you.
ok, done. next what i have to do? there is "for each file in files, what does it mean? i just want to open evey image on my folder and the message box will appear everytime i open an image
User start process activity and pass file variable. And run the process and check…all files in that folder will be opened.
Let me know your requirement in detail…You want to open all images in a folder? What message box you need?
i just want to open all images in folder 1 by 1, evey image that i open will appear a message box “pict 1, 2, 3, …” just like that until the last image that i open
Please check attached .xaml file. Place it in your project file and open in UiPath and gothrough. I have done similar process to reach image with OCR and display data in message box.
Let me know if further queries. If you find solution what you are looking mark my message as solution.folder_all_files.xaml (13.0 KB)
i have many question hehe, sorry.
- what i have to do with “start process” bar and why you put delay early? is it ok if i put delay after ocr do his job for capturing data that i want?
- what is “attach window” for?
- what is “close application” for? because i can’t select “x” bar, it selected whole screen
sorry for the question…
- Start process will open the file which ever it is. It may be excel, pdf, anything. In File variable we have each file from folder from for loop. So we place file in start process. Try to print file in write line. You can see links/paths of all files in folder which we provided.
Delay, I placed so that chances to open file/pdf doc in my case may get delay. If not OCR will throw error immediately that file not found.
Attach window is for image preview doc in my case to read data of image which I marked in my OCR scrapping.
Close application, Once one file is processed before opening next file from folder it will close first one. To close I have used Close application activity. You can find in selector, it will work for all files but should be same extension i my case it is images. Default open application for all images in windows preview.
NO problem. You can post further queries if any.
Can you share exception detail content?
The place which you selected for one document and pother document at same place it is empty. Check position. You need to add exception handler to catch that error and move forward with other doc.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.