Issue with copy/move from trash folder in a script

Hello,

In a dual lister, i try to copy from my source lister which is windows 'trash' folder to another destination folder.

If I use only Standard Function (Dopus or external) = 'Copy' it is working well.
But if i use RunCommand("Copy") in a script it is not working (nothing is happening).
And the RunCommand is working well for other source folder, so there seems to be an issue when this source folder is Windows Trash special folder.

Here is the simple script used for this example.

function OnClick(clickData)
{
	var cmd = clickData.func.command;
	cmd.RunCommand("Copy");
}

Is there a way to be able to use Copy command (and move) in a script when source is windows trash special folder ?
Also i'm wondering why Standard Function is working and the same function inside a script is not.
(nota : i really need to do this in a script because i have a more complex behavior in my real world script).

Thx in advance,
Cheers
Antoine

The problem is because the script's Command object won't have a list of files to work on, due to the Recycle Bin being a special case.

You could run this from a script if you know the files you want are already selected, and have the desired destination folder set up in the other side of the lister:

function OnClick(clickData)
{
	var cmd = clickData.func.command;
	cmd.RunCommand("Copy");
}

However, the copy will run asynchronously. If you need to wait for it to complete and then run more commands on the output, I am not sure there is a good solution for copying out of the recycle bin using scripting.

ok i understand thanks for this understanding of recycle bin behavior.

Indeed, I can see that 'clickData.func.sourcetab.selected' is always an empty list with recycle bin folder, even if files are selected. good to know this :slight_smile:

1 Like