Opening search results in a different tab

Hi,

When conducting a search, Dopus groups the results in a single tab. When clicking one of the results, it opens the corresponding file and loses all other results.

I first lock the result tab so it can't be modified and then right-click on a result and choose "Open Containing folder".

Is it possible to set Dopus so that clicking (could in combination with holding a given key like Ctrl...) on one of the results opens the result in a different tab rather than opening the file from the results and losing the search results?

I appreciate any help you can provide.

Best,

Jean

Same as normal folders, you can set up events to do different things via middle double-click, or when holding down Shift, Ctrl or Alt and left double-clicking. It's done via Settings > File Types > All Folders > Events, which will also show you the defaults.

(I'm not sure if these are the defaults or if I've changed them, so check what yours do.)

You can also drag folders down to the tab bar to open them in new tabs.

Hi,

Thanks for your quick reply.

I looked at Settings > File Types > All Folders > Edit > Events. The dialogue box looks similar to yours apart from the "left double-click + Shift" set to "go new".

I tried all three combinations with "left double-click + Alt/Ctrl/Shift"; none currently do what I'd need.

I was not clear. After a search, I can choose "Open containing folder " if I right-click on a search result. If I do that, the containing folder replaces the search results.

I need to do the same by, for example, with "left double-click + Ctrl" to open the containing folder in a new tab rather than replacing the content search results.

Thank you in advance for your help.

Best,

Jean

You could do this to make the right-click menu item open the containing folder in a new tab:

go opencontainer NEWTAB=findexisting

I'm also looking for an option to open search results in a new tab by default.

Results themselves (there's a drop-down for that in the Find panel), or what happens when you double-click folders within results?

this is not a "default with double-clicking" thou i made this button which i hotkeyed to Alt+D to open search results in a new tab.

<?xml version="1.0"?>
<button backcol="none" display="both" hotkey="alt+D" hotkey_label="yes" label_pos="right" separate="yes" textcol="none">
	<label>Open Everything Search Item In New Tab</label>
	<tip>Open Everything Search Item In New Tab</tip>
	<icon1>#DOpusBasic:newquery</icon1>
	<function type="normal">
		<instruction>@hideifpathr:!^coll://</instruction>
		<instruction>Go OPENCONTAINER NEWTAB=findexisting</instruction>
	</function>
</button>

to try that button copy the code block and paste it onto your toolbar when in Customize Mode.
and note that is button will hide itself when you are not actively viewing search results

After a bunch of messing about, I was able to get it to work with an evaluator expression.

Go to the File Types menu > "All Folders" > Click the "Events" tab > "Left double-click"

And replace or comment out the default 'go' with this line:

=Return !InStr(sourcepath, "coll://%%Lister-Quick-Find-Results%%/",0) == -1 ? "Go newtab" : "Go"

A few random notes I discovered for future reference:

  • The source path displayed for the search results is different depending on how it's fetched
    • Using standard function like @Output {sourcepath}:
      • coll://%%Lister-Quick-Find-Results%%/

    • Using Evaluator like @Output {=sourcepath=}:
      • coll://%Lister-Quick-Find-Results%/

    • HOWEVER behind the scenes the evaluator seems to use the double %% version even if it returns a single % using @Output, so when doing something like:
      @Output: Console Output: {=Output(sourcepath)=}
      • You can see the evaluator output and console output are different (this was confusing me a lot):
      • 7/18/2024 12:46 PM Evaluator: coll://%%Lister-Quick-Find-Results%%/ ...
        Console Output: coll://%Lister-Quick-Find-Results%/ ...

  • The syntax for what will work within an 'Event' isn't the same as what works with a button
    • First off, I assume there's additional handling behind the scenes so that simply putting Go in a double click event works, but if you wanted to use it in a button you'd need to add a parameter for the path and like Go fromsel. So keep that in mind if trying to use the code above somewhere else.
    • Also turns out if you just copy the line above and use it in a button it won't work for another reason, which is in a button you instead need to test "source" instead of "sourcepath" for some reason. And strangely you can't use "source" in the Event script, it needs to be sourcepath
      • Ok actually I figured out why. Take the following two lines for example:

        =Output("Sourcepath: " + sourcepath)
        =Output("Source: " + source)
        

        When ran from the button with a set of search results it yields this:

        7/18/2024 1:33 PM Evaluator: Sourcepath:
        7/18/2024 1:33 PM Evaluator: Source: coll://%%Lister-Quick-Find-Results%%/%3925696e91b93e39672e9054b05f95fc2db45a7d-0000000000140C4E

        But when instead ran from a double click event it yields this:

        7/18/2024 1:34 PM Evaluator: Sourcepath: coll://%%Lister-Quick-Find-Results%%/%3925696e91b93e39672e9054b05f95fc2db45a7d-0000000000140C4E
        7/18/2024 1:34 PM Evaluator: Source: C:\Users\Joe\Desktop\Tests\Backup Opus Script