Find files and then select

Hey there in the command below, the Select ALL command isn't working. I tried to put a @sync: in front of the find command also, so it would wait for the Select ALL command but that didn't work also.
Once the files are listed I just want to select all, so I can run a command line .exe on them all.
Thanks for any pointers. I know filters don't work recursively with Select, need this one to be recursive.
Alan.

Find (*.eps|*.png|*.jpg|*.psd|*.tga|*.tif|*.tiff|*.eps|*.ai|*.svg) IN {sourcepath} CLEAR RECURSE  
//Go {sourcepath}
//Select ALL

Alternative approach which works (but is not ideal if there are lots of files, could be slow):

Set FLATVIEW=mixednofolders,on
Select *.(eps|png|jpg|psd|tga|tif|tiff|eps|ai|svg)

Or slightly cleaner variant (uses quickfilter to hide irrelevant files):

Set FLATVIEW=mixednofolders,on
Set QUICKFILTER *.(eps|png|jpg|psd|tga|tif|tiff|eps|ai|svg)
Select All
1 Like

Do you want to see and possibly modify the find results before running the command on them, or do you want it to be fully automated without displaying the intermediate results?

No need to modify the results, was looking at working with the file collection and deleting it, whatever way is the most simple, the wildcard search is fool-proof enough, that I can go ahead and execute.
Thanks.

In that case, I would do the whole thing in one go using a script.

Edit the first few lines to change which command it runs on the files, or the wildcard.

function OnClick(clickData)
{
	// ----- Configuration --------------------------------------------------------
	// Remember to double-up any backslashes in cmdLine.
	var cmdLine = '@sync:"C:\\Windows\\Notepad.exe" {filepath$}';
	var wildcard = "*.(eps|png|jpg|psd|tga|tif|tiff|eps|ai|svg)";
	var isRecursive = true;
	// ----------------------------------------------------------------------------

	var cmd = clickData.func.command;
	cmd.deselect = false;
	cmd.ClearFiles();

	if (clickData.func.sourcetab.path == null)
		return;

	var wild = DOpus.FSUtil.NewWild(wildcard);

	var folderEnum = DOpus.FSUtil.ReadDir(clickData.func.sourcetab.path, isRecursive);
	var anyFiles = false;
	while (!folderEnum.complete)
	{
		var folderItem = folderEnum.Next;
		if (!folderItem.is_dir && wild.match(folderItem.ext_m))
		{
			cmd.AddFile(folderItem);
			anyFiles = true;
		}
	}

	if (!anyFiles)
		return;

	cmd.RunCommand(cmdLine);
}

As always with anything automated and recursive, I recommend testing against a backup copy of some data first, in case it doesn't work as expected.

Thanks a lot guys, as the flat view is simple and works for my needs, it is up and running. So I have this version using the first suggestion by bytespiller, and then I have another version that is hot-keyed for when I am in a folder and want to do specific files. -so great works fine, also this process just makes files so the chances of it doing anything under the radar, with recursive on, are not a worry. Thanks for taking the time.


@set path = "C:\solidangle\mtoadeploy\2017\bin\maketx.exe "
Set FLATVIEW=mixednofolders,on
Set QUICKFILTER *.(png|jpg|psd|tga|tif|tiff)
Select All
//Convert to .tx files
{$path} -v -u --unpremult --oiio --threads 20 {filepath} -o {filepath|ext=.tx}
Set FLATVIEW=off
Set QUICKFILTERCLEAR