Copy to {rightpath} with Queue : is there a way to freeze destination path at the copy action?

Hello,

I have some issues with queue in a dual lister.

I often copy files and folders from left pane to right pane (or right pane to left pane).

In my script I use this command :
Copy MOVEWITHSHIFT RENAMEWHENSAME WHENEXISTS=ask TO={rightpath}
(it could probably be simplifed to Copy TO={rightpath} for my explanation)

Dopus is managing the queue via checked option Automatically manage file copy queues*.

For example, if I select a large file in my left pane and i use this command : it will copy this file to to the folder in the right pane (and starts immediately).
During this 1st copy, i can select a 2nd file and do the same thing : so this 2nd file is enqueued automatically by dopus and will start copying after the 1st file is over. Imagine i could do this for 10 or 20 files. etc.

During this process of copying which could be long for large files, i do many other things, and i will navigate though my folders. And many time i will change the folder opened in the right lister, or opening a new tab, etc.
The problem is : when Dopus has finished to copy current file, it will copy the next file in queue to my current active folder in the right pane... And this folder in the right pane is completely different from the one I was in when i've choosen to copy/enqueue the file...
And it could be really a mess if you imagine that i copy many files during the day and changing all the time my current folder during the process... :cold_face: (seriously i've lost files because of that :rofl: )

My question is :
Is there a way for Dopus to enqueue a file for copy and 'freeze' the destination path when i execute the copy command ? I mean : at the exact moment i'm deciding to copy and enqueue the file, Dopus could know what are my left path and right path, and keep that as the rule ?

I put some pictures here to make it more understandable :

1. i copy these two files on the left pane to the folder A on the right pane (with my command above).
As you see 1st file is long to copy so I can do things during this time. The 2nd file is enqueued.

  1. During this time i navigate in my right pane. Let's say i'm in B folder at that moment. You can see the 1st file it reaching the end.

  1. 2nd file is starting and it's copying where i'm now in my right pane (which is folder B). I would rather expect it to go in A folder where i was when i've launched the copy command.
    At the end I have 1st file in my A folder and 2nd file in my B folder. It's not what i want :slight_smile:

Thanks in advance for your answers !

Cheers,
Ant

Since you're doing it from a script, get the path in the right pane and put the actual path into the command instead of using {rightpath}.

1 Like

yes of course i hadn't think about this.
Great ! it's working now ! :slight_smile:

here below is my all script for people interested in :

i run it with CTRL+RIGHT key (or CTRL+SHIFT+RIGHT key)

  • if source is left and destination is right => it will copy selection from left to right with CTRL+RIGHT (or move them if CTRL+SHIFT+RIGHT)

  • if source is right and destination is left => it will clone selection with a confirmation dialog

i have another similar script for CTRL+LEFT which is using left pane (same idea).

function OnClick(clickData)
{
	var cmd = clickData.func.command;
	var righttab = (clickData.func.sourcetab.right == true ? clickData.func.sourcetab : clickData.func.desttab);

    if (String(clickData.func.sourcetab.path) === String(righttab.path)) {
		// clone selection (source = destination) and asks for confirmation
		if (clickData.func.Dlg().Request("Duplicate in Source (clone) ?","Yes|No") == 0) {
			// Abort.
			return;
		}
	}

	// copy / move selection
	cmd.RunCommand("Copy MOVEWITHSHIFT RENAMEWHENSAME WHENEXISTS=ask TO=\""+String(righttab.path)+"\"");
}
1 Like

The path after TO= should be enclosed in quotes in case it contains spaces.

2 Likes

thanks :wink:
i've updated the code above

Thanks for your script, it's useful for me.