View previous topic :: View next topic |
Author |
Message |
rissos
Joined: 31 Dec 1969 Posts: 7
|
Posted: Thu Jun 30, 2011 11:29 pm Post subject: For each... (logic) moved from vbscript to Automize 9 |
|
|
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 |
|
 |
Robert Site Admin
Joined: 25 May 2006 Posts: 1140
|
Posted: Tue Jul 05, 2011 2:48 pm Post subject: |
|
|
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 |
|
 |
rissos
Joined: 31 Dec 1969 Posts: 7
|
Posted: Mon Jul 25, 2011 6:01 am Post subject: Post subject: For each... (logic) moved from vbscript to Aut |
|
|
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 |
|
 |
Robert Site Admin
Joined: 25 May 2006 Posts: 1140
|
Posted: Wed Jul 27, 2011 10:18 pm Post subject: |
|
|
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 |
|
 |
|