Search all tabs?

The title pretty much says it all, is there a way to automatically import all the paths from the tabs in a dual lister into the "Add folder to search" area after a CTRL+F?

I'll take the silence to mean there's no easy default way to do this. Is it possible to script this on the user end? I skimmed through the chm and see dopus supports vbscript. Before I set aside time to try to implement this though, I'd appreciate it if one of the developers could comment on whether the dopus object model is robust enough to pull this off. Thanks for the help!

If you change Ctrl+F to run this JScript instead of the normal command, it will send all tabs in the current window into the Find In list.


function OnClick(clickData)
{
	cmd = clickData.func.command;
	cmd.deselect = false;
	cmd.ClearFiles();

	fsu = DOpus.FSUtil;

	pathSet = DOpus.Create.StringSet();
	for (var eTabs = new Enumerator(clickData.func.sourcetab.lister.tabs); !eTabs.atEnd(); eTabs.moveNext())
	{
		pathSet.insert(fsu.Resolve(eTabs.item().path));
	}

	if (!pathSet.empty)
	{
		cmdLine = "Find IN";
		for (var ePaths = new Enumerator(pathSet); !ePaths.atEnd(); ePaths.moveNext())
		{
			cmdLine += " \"" + ePaths.item() + "\"";
		}

		cmd.RunCommand(cmdLine);
	}
}

Brilliant, works like a charm. Thanks Leo.

Yes, brilliant great idea and great script! Thank You

Hi, this code no longer works for me. I realise the formatting is a bit messed up but I have a button with the correct code from a couple of years ago. Has anything changed that would prevent this from working?

Here is the error.

  • 11/07/2018 12:05 Error at line 2, position 1
  • 11/07/2018 12:05 {
  • 11/07/2018 12:05 ^
  • 11/07/2018 12:05 Invalid character (0x800a0408)
  • 11/07/2018 12:05 Parse error - script aborted

Regards

Blueroly

I've fixed the post formatting.

From the error message I would guess the button is set to use VBScript instead of JScript.

Correct. Thanks Leo.