Selecting Like Files

Hello everyone,

What I have been attempting to do is highlight (select) similar files from a group of files. That is it!
John_Doe (1).jpg
John_Doe=y(2).mpeg
John_Doe (3).png
John Doe (1).jpg
John Doe (2).avi
John Doe.x.(3).txt
John.Doe (1).xls
John.Doe (2).doc
John.Doe_x_(3).prt

In this example, I would like to highlight (select) any John_Doe file and execute a button to select those with similar John_Doe files. Or alternatively, select a John.Doe file and execute a button command to select those with similar John.Doe files, etc. Extensions are not relevant.

I was attempting to use Select SIMILARBASE as part of my script but honestly, I have already spent a good couple of hours trying different things and got absolutely nowhere.

Is this something that is possible to achieve? Is this more complex than it looks?

Please help.

SIMILARBASE works by using the full base name of the selected files, not just a portion that happens to look common to you.

You probably want a pattern match, but you'll have to enter the string. Try this:

Select PATTERN {dlgstringS}.

Enter as much of the pattern as you consider unique to select the desired files.

I went the same path is MrC, but grabbed the name from the selected file so you don't have to type as much. If no file is selected, it basically works like MrC's except I have wildcards * before and after what text you enter in, just in case what you want is in the middle of the name.

@nodeselect @set BaseName={dlgstring|Set Base Name to Select:|{file|noext}} @filesonly Select "*{$BaseName}*"

Actually, I think I'll keep this button. I like it :slight_smile:

Cool. There's no need to set any vars though.

@nodeselect Select *{dlgstring|Set Base Name to Select:|{file|noext}}*

Needs the quotes though :wink:

@nodeselect Select "*{dlgstring|Set Base Name to Select:|{file|noext}}*"

Ah, good to know. Thx :slight_smile:

I also messed up on the @filesonly. Needs to be "TYPE=files"

@nodeselect Select "*{dlgstring|Set Base Name to Select:|{file|noext}}*" TYPE=files

Unless you want files and folders, of course.