Filter/Select Multiple Files

Two quick hacks.

Select

function OnClick(clickData) {
    if (DOpus.GetClipFormat() != 'text') return;

    var cmd = clickData.func.command;
    var tab = clickData.func.sourcetab;
    cmd.deselect = false;

    var items = DOpus.GetClip().split(', ') || [];
    cmd.ClearFiles();
    for (var i = 0; i < items.length; ++i) {
        cmd.AddFile(tab.path + '\\' + items[i]);
    }
    cmd.RunCommand('Select FROMSCRIPT SETFOCUS');
}

CSV Select From Clipboard.dcf (1.1 KB)

Filter

function OnClick(clickData) {
    if (DOpus.GetClipFormat() != 'text') return;
    var cmd = clickData.func.command;
    var filter = '"(' + DOpus.GetClip().replace(/, /g, '|') + ')"';
    cmd.RunCommand('Set QUICKFILTER=' + filter);
}

QuickFilterFromClipboard.dcf (741 Bytes)


2 Likes