![]() |
| |||||||
Automation Anywhere Post messages and questions related to Automation Software here. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| |||
|
Problem: Scanning a multi-page document to a single PDF file into a folder on the network. The AA script is designed to trigger based on a new file created in the folder. The scanning process immediately establishes the pdf file which causes the script to activate; however, the file is still scanning the balance of the pages to the file and the script crashes since the file is busy. Current Solution: Use a fixed wait time well in excess of how long it might take for the scanning (file creation) to complete. Seems inefficient. Question: How can I control the script to wait for the file to complete it's copy before having the script take action on the file. |
| |||
|
Hello, Can you please tell us, when scanning is in process, do you see any window or popup that shows the scanning process is on or is there any application or service running in background that ends when the file scanning process completes. In that case you can use 'Loop' command with condition to wait till that condition is true and when the condition returns false i.e. when the file scanning is completed the task will come out of the loop and will execute the commands after the loop. For e.g. lets say if a window appears at the time of scanning then you can use following commands to wait until window disappears i.e. when the scanning is over. Loop While Window Exists("Window Title") Delay: (300 ms) End Loop Comment: commands to take action on file Also, when the script crashes (since the file is busy) do you get any error message? If yes, then can you please upload screenshot of it? you can use 'Error Handling' command (available in Enterprise version only) to trap the error number and loop or wait until there is no error. Text format of commands would appear as follows, Loop While $GlobalVar$ Not Equal To "A" Begin Error Handling; Action: Continue; Options: Log to File Log to File: GlobalVar=0 in "C:\Temp.txt" Comment: Command to perform action on file End Error Handling If $GlobalVar$ Equal To "0" Then Log to File: GlobalVar=A in "C:\Temp.txt" End If End Loop In above example $GlobalVar$ is a value type of variable that reads value from a text file, C:\Temp.txt. Using Error Handling command we will assign the error number to GlobalVar variable using 'Log to File' option of Error Handling command. This task would loop until GlobalVar is 0 i.e. until there is no error. Hope that helps. |
![]() |
| Thread Tools | |
| Display Modes | |
| |