hiteksoftware.com Forum Index hiteksoftware.com
User discussion forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

For each... (logic) moved from vbscript to Automize 9

 
Post new topic   Reply to topic    hiteksoftware.com Forum Index -> Frequently Asked Questions
View previous topic :: View next topic  
Author Message
rissos



Joined: 31 Dec 1969
Posts: 7

PostPosted: Thu Jun 30, 2011 11:29 pm    Post subject: For each... (logic) moved from vbscript to Automize 9 Reply with quote

Hi All,
We are new working with Automize tool but we are exited about it!

I search in the Forum and did not find anything related to my concern.

Basically, the question is:

We have some VBscripts that monitor different things. Often in them we have a Logic like "For Each Item in My ItemCollection" copy file(s) or delete file(s)...
where ItemCollection is an Array of "Folders" or names which are part of the path to a folder, but not every subfolder of the directory is in the Array, only a selection declared before in the script.

How could we replace this with few Tasks (1 for entering selected folders + 1 for copying or deleting files) and a sequence in Automize??

I think we would have to use some Variables for these Paths names or selection of folders or whats the best way to Achieve this?

Thanks for your help!
San
Back to top
View user's profile Send private message
Robert
Site Admin


Joined: 25 May 2006
Posts: 1140

PostPosted: Tue Jul 05, 2011 2:48 pm    Post subject: Reply with quote

You can try this:
1) Run a Subdirectory Loop task. For every subdirectory found, there are different variables like CurrentSubdirectoryPath or SubdirectoryName etc.
2) From this subdirectory loop task, run a CSV loop task which holds your array of folders (one per line in a text file).
3) The CSV loop task will put each line into a variable (run it once and it will show you the variables)
4) From the CSV loop task, run a Variable monitor task. In the variable monitor task, compare the subdirectory loop task variable and CSV loop task variable.
5) If the variables match, run the copy/delete task etc.. and pass the desired variables.
Back to top
View user's profile Send private message
rissos



Joined: 31 Dec 1969
Posts: 7

PostPosted: Mon Jul 25, 2011 6:01 am    Post subject: Post subject: For each... (logic) moved from vbscript to Aut Reply with quote

Hi,
Could you extend your explanation of points 2 and 3?
thanks

San

Robert wrote:
You can try this:
1) Run a Subdirectory Loop task. For every subdirectory found, there are different variables like CurrentSubdirectoryPath or SubdirectoryName etc.
2) From this subdirectory loop task, run a CSV loop task which holds your array of folders (one per line in a text file).
3) The CSV loop task will put each line into a variable (run it once and it will show you the variables)
4) From the CSV loop task, run a Variable monitor task. In the variable monitor task, compare the subdirectory loop task variable and CSV loop task variable.
5) If the variables match, run the copy/delete task etc.. and pass the desired variables.
Back to top
View user's profile Send private message
Robert
Site Admin


Joined: 25 May 2006
Posts: 1140

PostPosted: Wed Jul 27, 2011 10:18 pm    Post subject: Reply with quote

1) create a text file which contains your list. one folder path per line.
2) create a CSV loop task (tasktitle = csvloop) against this text file
3) create a subdirectory loop task.
Task to run = csvloop

run the subdirectory loop task.. then look at the logs, variables etc... that's the best way to figure out things.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    hiteksoftware.com Forum Index -> Frequently Asked Questions All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group