brianm
November 8, 2022, 9:45pm
1
In the script below,
@ifpath:coll://
or
@ifpath:coll://*
isn't working.
I want to remove the selected items in the destination-tab.
I often run
Select SOURCETODEST DESELECTNOMATCH
first.
Please advise how to get it to work.
Script :
set dest=toggle
@ifpath:coll://*
Delete REMOVECOLLECTION
// Select *.* deselect
// Select postman.exe
@ifpath:common
set dest=toggle
Leo
November 8, 2022, 10:01pm
2
@ifpath and similar @modifiers are evaluated before any commands run, so it would be testing the source path not the destination one.
Using scripting would be better here, as you can simply tell Opus to run a command on the destination tab:
function OnClick(clickData)
{
clickData.func.command.deselect = false;
var cmd = DOpus.Create.Command();
if (clickData.func.sourcetab.lister.dual)
{
var dest = clickData.func.desttab;
var path = dest.path;
if (path.Root() && path == "coll://")
{
cmd.SetSourceTab(dest);
cmd.RunCommand("Delete REMOVECOLLECTION");
}
}
}
lxp
November 9, 2022, 10:23am
3
To not lose the selection, I'd rather use
var cmd = clickData.func.command;
Leo
November 9, 2022, 10:43am
4
That would get you the selection from the wrong side, I think.
lxp
November 9, 2022, 11:21am
5
Wouldn't the command object be empty?
A Command object can be created by the DOpusFactory .Command method. By default, this object has no source, destination, files to operate on, etc.
Leo
November 9, 2022, 11:27am
6
The script works for me, so the cmd.SetSourceTab(dest)
seems to be sufficient to set up the command object, at least for the command being run.