GP SoftwareTwitter
Opus FAQsManualCommandsObjects

Select Similar Files With Double Extensions


So I have these files in folder "Note" open up in Destination pane:

I have these files in a different folder "Info" than above in Source pane:

Is there a good way to select all matching files in the first Destination folder while in the Source pane, or vice-versa? Because I tried using Select SIMILARBASE but it does not work well since Note* basically have double extensions. SIMILARBASE works fine when it's simply the same name with a different extension.

Also, is there a good way to quickly visually filter out the files/folders that matches in conjunction with selecting them?


Anyone? Basically I want to use Select SIMILARBASE but instead of selecting all files with a similar base in the Source pane, I want it to select the files with a similar base in the Destination pane. Similar to how Select SOURCETODEST=in would have behaved.


Here's a script that will do it:

Option Explicit
Function OnClick(ByRef clickData)

	if clickData.func.sourcetab.lister.dual = 0 then Exit Function

	Dim files
	Set files = DOpus.Create.StringSetI

	Dim f, g
	for each f in clickData.func.sourcetab.selected

		for each g in clickData.func.desttab.all
			if StrComp(g.name_stem,, 1) = 0 then files.insert g


	if not files.empty then
		Dim cmd	
		Set cmd = DOpus.Create.Command
		cmd.deselect = false
		cmd.SetSourceTab clickData.func.desttab

		for each f in files
			cmd.AddFile f

		cmd.RunCommand "Select FROMSCRIPT"

	end if
End Function


Thank you! It works splendidly!