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 06-25-2010, 12:13 AM
brianc brianc is offline
Junior Member
 
Join Date: Jun 2010
Posts: 8
Default Logic to loop through sets of files

I have a folder with images. I need to open the first 12 within a program, and after I process them, I need to open the next 12 and so on and so on. How do I get AA 6.0 Premier to loop through and grab the first 12 images... process them and then grab the next 12? I am pretty new to this, but I am a programmer and can follow the logic. I would appreciate any direction or if there is an example floating around that does this.

Thanks,

Brian
Reply With Quote
  #2 (permalink)  
Old 06-25-2010, 03:33 PM
forumsupport forumsupport is offline
Senior Member
 
Join Date: Apr 2007
Posts: 1,342
Default

Hello,

You can try this,

Start Loop " Each File in C:\Temp"
Variable Operation : $Counter$ % 12 To $Prompt-Assignment$
If $Prompt-Assignment$ Equal To "0" Then
//Process files
End If
End Loop


In above code, task will loop for all files in specified folder and would calculate the set of 12 iterations by checking the reminder using $Counter$ % 12. After every 12 iteration reminder would be zero so inside If condition you can put commands to process those files.

Hope that helps.
Reply With Quote
  #3 (permalink)  
Old 06-25-2010, 05:18 PM
brianc brianc is offline
Junior Member
 
Join Date: Jun 2010
Posts: 8
Default

The $Counter$ % 12 is foreign to me. What is the percentage sign doing exactly? After testing, this is actually iterating through the loop 9 times and stopping.
Reply With Quote
  #4 (permalink)  
Old 06-25-2010, 05:25 PM
brianc brianc is offline
Junior Member
 
Join Date: Jun 2010
Posts: 8
Default

I see.. it is checking to see if it is a muliple. Something is only causing 9 images to load... so let me look into the further.
Reply With Quote
  #5 (permalink)  
Old 06-25-2010, 09:45 PM
forumsupport forumsupport is offline
Senior Member
 
Join Date: Apr 2007
Posts: 1,342
Default

Hello,

% is a modulo operator, used to find the reminder. May we please know if all the files in a folder are image files? If you can upload your task, we can look into it and provide viable solution.
Reply With Quote
  #6 (permalink)  
Old 06-26-2010, 09:14 AM
brianc brianc is offline
Junior Member
 
Join Date: Jun 2010
Posts: 8
Default

I was able to get it working. That modulo thing is pretty brilliant. I figured out why it was stopping at 9... the textfield did not have enough room for 12 full pathnames... fixed this no, problem by setting the path first on the open file page and then setting just the filenames.
Reply With Quote
  #7 (permalink)  
Old 06-26-2010, 09:15 AM
brianc brianc is offline
Junior Member
 
Join Date: Jun 2010
Posts: 8
Default

And thank you for your help!
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 07:01 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