Intelligent Automation & Macro Software  

Go Back   Automation Anywhere, Inc. Forums > Products Zone > Automation Anywhere
Register FAQ Search Today's Posts Mark Forums Read

Automation Anywhere Post messages and questions related to Automation Software here.


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-10-2009, 11:27 AM
jmoconnell jmoconnell is offline
Junior Member
 
Join Date: Apr 2009
Posts: 1
Default Trigger based on new file creation problem

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.
Reply With Quote
  #2 (permalink)  
Old 04-10-2009, 09:55 PM
forumsupport forumsupport is offline
Senior Member
 
Join Date: Apr 2007
Posts: 1,342
Default

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.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -7. The time now is 03:16 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.0 ©2007, Crawlability, Inc.
Copyright © 2003-2011 Automation Anywhere, Inc. All rights reserved