Can I use screen scrapping for multiple pdf dynamically?

Hi,
Typically, to edit the Selector to include a variable, you will need to edit the selector as a string. To do so, click in the Selector property as shown in the image previously, but do not click on the Edit button with 3 dots. You will notice that in the Selector property, the selector is a string surrounded by quotes… now, if you remove a character, click outside of the box, then click on Edit, it will bring up the Expression editor where you can edit the string more freely (just make sure you put back whatever character you deleted). - or you can just simply edit the string in the Selector property box, but it is very small.

All in all, you will end up having a selector string that looks like this:

"<wnd app='acrord32.exe' cls='AcrobatSDIWindow' title='"+fileNAME+"*' />"

However, it is good practice to replace the extension in the filename and surround both sides with a wildcard.
With that in mind, we can use Path.GetFilenameWithoutExtension(), and it will look like this:

"<wnd app='acrord32.exe' cls='AcrobatSDIWindow' title='*"+Path.GetFilenameWithoutExtension(fileNAME)+"*' />"

Additionally, if you want, you can create a string variable to store this selector before you use it, so you can use it on multiple activities with better maintainability.

If you receive any errors, feel free to post them and I’ll see if I can help identify the issue.

Regards.

1 Like