Intelligent Automation & Macro Software  

Go Back   Tethys Solutions 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 06-09-2008, 02:18 PM
Maprwz Maprwz is offline
Junior Member
 
Join Date: Jun 2008
Posts: 14
Question Loop on Each File is not working

I'm building my first prototype in AA 4.5.2 and I cannot get it to work at all.

My first statement is:
Start Loop "Each File in C:\Wrapper\BatFiles"
I put a file in the folder and run the task but it never gets to the second statement which is a Message Box.
Reply With Quote
  #2 (permalink)  
Old 06-10-2008, 03:30 AM
forumsupport forumsupport is offline
Senior Member
 
Join Date: Apr 2007
Posts: 465
Default

Hello,

Could you please tell us do you receive an error? If yes, then please send us screenshot of it so that we can actually see. In addition, please paste the text format of your task so that we can look into it if anything is going wrong. For that, open your task in a Task Editor, go to Tools->Save as text file.

It would help us investigate further.
Reply With Quote
  #3 (permalink)  
Old 06-10-2008, 08:23 AM
Maprwz Maprwz is offline
Junior Member
 
Join Date: Jun 2008
Posts: 14
Default Here is the code

I do not receive an error. Perhaps the Start Loop is working but some of the other statements are not working. Why do I think this? Because when I run this version in Debug mode:
  • it shows me EVERY line highlighted in yellow regardless of whether the IF was true or false or whether the Loop was to be executed or not
  • the Message Box does not appear
  • the Copy Files does not copy
  • but the "Open File" of the BAT file works
  • and the "Delete Files" of the BAT file
Ah! Does the "Copy Files" command overwrite an existing file? Or do I have to delete the previous file before copying the new one?

----------------------------------------------------------
1 Variable Operation : True To $FOREVER$
2 Loop While $FOREVER$ Equal To "True"
3 Start Loop " Each File in C:\Wrappers\AutoAnywhere\BatFiles"
4 Message Box: "[$FileName$]"
5 Variable Operation : 0 To $GOTBAT$
6 If $Extension$ Equal To "BAT" Then
7 Variable Operation : 1 To $GOTBAT$
8 End If
9 If $Extension$ Equal To "bat" Then
10 Variable Operation : 1 To $GOTBAT$
11 End If
12 If $GOTBAT$ Equal To "1" Then
13 Copy Files "$CurrentDirectory$\$FileName$.$Extension$" to "C:\Wrapper\AutoAnywhere\BatFiles\CobolName.tx t"
14 Delay: (100 ms)
15 Open File "$CurrentDirectory$\$FileName$.$Extension$"
16 Variable Operation : 0 To $ENDJOB$
17 Comment: COBJOB is a list of COBOL.EXE's read from the .txt file
18 Start Loop " List Variable COBJOB"
19 Variable Operation : $COBJOB$ To $CobolName$
20 Variable Operation : 0 To $ENDPROG$
21 Loop While $ENDPROG$ Equal To "0"
22 Delay: (100 ms)
23 If Application Not Running ("$CobolName$") Then
24 Variable Operation : 1 To $ENDPROG$
25 End If
26 If Application Running ("F3BKDSNP.exe") Then
27 Variable Operation : 1 To $Popup$
28 Loop While $Popup$ Equal To "1"
29 Activate Window: "COBOL*"
30 Get Text from Window : "COBOL*" Assign to variable "$WindowText$"
31 If $WindowText$ Includes "Do you want to open the report file" Then
32 Click On Command Button : "No" in Window : "COBOL ERROR REPORT"
33 Variable Operation : 0 To $Popup$
34 Variable Operation : 1 To $ENDJOB$
35 Variable Operation : 1 To $ENDPROG$
36 Else
37 Click On Command Button : "OK" in Window : "COBOL"
38 End If
39 End Loop
40 End If
41 End Loop
42 If $ENDJOB$ Equal To "1" Then
43 Exit Loop
44 End If
45 End Loop
46 Delete Files "$CurrentDirectory$\$FileName$.$Extension$"
47 End If
48 End Loop
49 End Loop
Reply With Quote
  #4 (permalink)  
Old 06-11-2008, 02:49 AM
forumsupport forumsupport is offline
Senior Member
 
Join Date: Apr 2007
Posts: 465
Default

Hello,

What we suggest is, disable debug mode (in task editor go to Debug->Disable Debugging) and try running the task again. Also remove square brackets [] from message box command and save the command. In addition, insert Delay command after every action or command in task. In Copy files command at, line # 13 extension includes space (CobolName.tx t), remove that space and try again.

Hope that helps.
Reply With Quote
  #5 (permalink)  
Old 06-11-2008, 07:44 AM
Maprwz Maprwz is offline
Junior Member
 
Join Date: Jun 2008
Posts: 14
Thumbs up Got it working

I cleaned up some other things and got it working.

Thanks.
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

vB 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 07:08 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.0 ©2007, Crawlability, Inc.
Copyright © 2003-2008 Tethys Solutions, LLC. All rights reserved