Hello,
As part of a WinAutomation (version 3.03.410) job, I am trying to retrieve all the folders named "Projects" within a directory into a list of folders to be processed later. The methods I have tried so far:
Method 1: First create an empty list and use the "Get SubFolders in Folder" action with "Include Subfolders" checked. Then, "For Each" folder in the list, use "Parse Text" on the folder name to see if it is called "Projects". Add any folders with the name "Projects" to the empty list.
Problem--the result is a "List of General Values" because the preprocessor doesn't know that I only added Folder variables to the list, so a later action to get the name of one of the folders in the list causes a preprocessor error.
Method 2: Use the "Get SubFolders In Folder" action with "Include Subfolders" checked. "For Each" folder in the list, add the index of any folders not called "Projects" to a list of numbers. Then, for each item in the list of indexes, use the "Remove Item from List" action on folder with the specified index.
Problem--each "Remove Item from List" action modifies the list so the indexes don't match the item they originally did.
Listed below are some actions I didn't see that I think would solve my problems with Method 2:
1) "Get Index of Item"--accepts a list and an item to search for, and returns either the first index of an item (-1 if the item does not exist) or a list of indexes of items that match (an empty list if no matches are found). I can make this happen using a nested "For Each" loop, but it won't be efficient.
2) "Sort List Descending"--the current "Sort List" action only accepts a single list argument. I didn't test it, but I imagine it only sorts in one direction. If I could sort my list of indexes in descending order, "Reomve Item from List"
3) "Remove Item(s) From List"--accept either one or several indexes of items to remove from a list (probably implemented by sorting the indexes in descending order). If one of the items does not exist, none of the list items are effected and an error message is returned.
I heard WinAutomation 3.1 is in beta testing right now--it would be nice if some of these actions were addressed in this or a later version of WinAutomation.
Edi: I also tried "For Each" member of the list of folders, if the name fo the folder isn't "Projects", remove the folder from the list directly inside of the loop (without storing a separate index list). After the "Remove Item from List" action, the action to reach the next folder in the list of folders failed.
An "If List Contains" [item] action would also solve my problem.


Actually, what I am discovering I really need is a "Merge Lists" action, that accepts two list parameters (that must be of the same type) and returns a third list of the same type containing all the items in both of the first two lists.
I resolved my issue from before somewhat more efficiently by using an "Exit Loop" action inside of a nested loop structure designed to get the index of the first item encounterd.
However, next I need to combine all the subdirectories of the "Project" folders into a single list of subdirectories, and then check the names of the folders to see if they have a certain syntax--so I need the list of subdirectories to be treated as a "List of Folders" instead of a "List of General Values". I'm not sure how I can accomplish this without a "Merge Lists" action.