Can I always use a new tab in search results to open a folder in the results?

Well, Alt-DoubleClick seems efficient enough, but that's just me :wink:


So... try the following:

Step :one:

Save CommandGoFromCollection.js.txt to

%appdata%\GPSoftware\Directory Opus\Script AddIns

Step :two:

Add GoFromCollection to your File Types like so:

You can also add the new command to a button, hotkey, context menu, etc. like any built-in command, or run it from the FAYT Command field.

Things you might enjoy reading

How to use buttons and scripts from this forum

The script's inner workings

JScript
function OnInit(initData) {
    initData.name = 'GoFromCollection';
    initData.version = '2023-09-20';
    initData.copyright = '';
    initData.url = 'https://resource.dopus.com/t/can-i-always-use-a-new-tab-in-search-results-to-open-a-folder-in-the-results/45911';
    initData.desc = '';
    initData.default_enable = true;
    initData.min_version = '12.0';
}

function OnAddCommands(addCmdData) {
    var cmd = addCmdData.AddCommand();
    cmd.name = 'GoFromCollection';
    cmd.method = 'OnGoFromCollection';
    cmd.desc = '';
    cmd.label = '';
    cmd.template = '';
    cmd.hide = false;
    cmd.icon = 'script';
}

function OnGoFromCollection(scriptCmdData) {
    var cmd = scriptCmdData.func.command;
    var tab = scriptCmdData.func.sourcetab;

    cmd.deselect = false;

    if (String((tab.path)).substring(0, 5) == 'coll:') {
        cmd.RunCommand('Go NEWTAB');
    } else {
        cmd.RunCommand('Go');
    }
}
2 Likes