How does one enumerate a collection of selected items?

This post in respect of this specification post I put out recently. I am assuming that it is feasible to script a solution to that problem and am looking for ways to do it. If I am totally off track please tell me :slight_smile:

The FSUtil.ReadDir method returns object:FolderEnum which allows for each Item object to be enumerated.
This seems clear enough and is applied in this script.
So the element linkage is

FSUtil.ReadDir > object:FoldrEnum > FolderEnum.Next > object:Item

Each object:Item in a folder can be acted upon in turn using object:FolderEnum in the following way:

	while (!folderEnum.complete)
	{
		// .Next Returns the next item in the enumeration
		//  as an Item object
		var subItem = folderEnum.Next();
		if (!subItem.is_dir)
		{
			// Insert your actions for each item
			// Here
		}
	}

I want to do something similar to the above but only for a set of selected items not the whole folder.
From what I understand the code above works on the entire folder.
So I go looking and I find the following linkage of VB elements:
Tab.selected_files > collection:Item
How would I emunerate each item in this collection?
Here are links for the Tab object and the returned collection:Item
It would seem I need the equivilant of object:FolderEnum for a collection of selected items.

I see this post and there seems to be a solution there but I am way out my depth trying to understand that for the moment. The sample code format seems all messed up for me. Is that my browser maybe? The last comment seems to say it is better not to do whatever they are doing.

I hope this makes sense thanks for any comments.. they are always really appreciated

Examples of that can be found in the default script. If you create a new button and switch it to script mode, you should see it. If not, click the Default button/menu above the script editor.

1 Like