More destinations in Copy function

[quote="Mou-Di"]Thank you for your answer. This helps allready for my first needs.
To have a more flexible System it would be helpful to mark in the right panel all the folders as target and then in the left panel the file I wanna copy. With an option/button "copy to all marked folders" I could save so much time![/quote]

I made a simple script button which will do this: Copy into multiple selected destinations.

BTW. I think my method (copy from one single lister source to all other opened single listers) is more flexible - you can copy to different drives too, not just to different folders. My procedure is not perfect, but works that way:

VBScript for button:

Option Explicit
Function OnClick(ByRef clickData)

Dim t, lister, veve, sourx, ndest, xx, doCmd, cmd, tab, selItem, folderEnum, folderItem, lstsourc
dim destix(1000)
lstsourc=""
ndest=0

For Each lister In DOpus.listers
	if lister.dual=0 then
		if lister.state=1 then
		sourx=lister.activetab.path
		else
		ndest=ndest+1
		destix(ndest)=lister.activetab.path
		end if
	end if
Next

DOpus.ClearOutput

Set cmd = clickData.func.command
cmd.deselect = false

If clickData.func.sourcetab.selected.count > 0 and ndest>0 Then
	cmd.Clear
	For Each selItem in clickData.func.sourcetab.selected
		if lstsourc<>"" then lstsourc=lstsourc&" "
		lstsourc=lstsourc&chr(34)&selItem.RealPath&chr(34)
	Next

	For t=1 to ndest
		if sourx<>destix(t) then
    cmd.SetModifier "async"
			cmd.RunCommand "copy QUEUE=copytoallx,quiet "&lstsourc&" TO="&chr(34)&destix(t)&chr(34)
		end if
	Next


End If

end function

What is missing:

  1. Check if lister is single.
  2. Check if there is no repeated the same destinations.
  3. Probably may be written better.
1 Like

Yes that's a valid alternative, remembering not everyone uses multiple Listers the way you do.

I understand that, that's why I write that is alternative for single listers mode. I think you can write your procedure to copy into all other tabs instead of selected folders and there will be real solution for dual lister with different paths.

The script I posted for Mou-Di literally does exactly what he asked for. You can do lots of other things, but they aren't what he asked for, so it isn't what was written.

My bad, I understand that wrong before I think.