Copy the path of all tabs

In Dopus there is a button for copy folder path (Edit-Copy Others-Folder Path), but it only for current tab. Is it possible to have a button to copy the path of all open tabs in a lister? My goal is to make it easy to connect between Dopus and open/save as dialog using windows 10 clipboard history without a 3rd app.

Copy the path of all open tabs in a lister...

Paste using clipboard history Windows 10 (Win+V)...

Can be done with a small script:

function OnClick(clickData)
{
	var lister = clickData.func.sourcetab.lister;
	var fsu = DOpus.FSUtil;
	var clip = "";
	for (var eTabs = new Enumerator(lister.tabs); !eTabs.atEnd(); eTabs.moveNext())
	{
		var path = fsu.Resolve(eTabs.item().path);
		clip += path + "\n";
	}
	DOpus.SetClip(clip);
}

Thank you for the reply. The script does not separate each path in the clipboard history but merges them into one.

2022-07-26_195638

function OnClick(clickData)
{
	var lister = clickData.func.sourcetab.lister;
	var fsu = DOpus.FSUtil;
	for (var eTabs = new Enumerator(lister.tabs); !eTabs.atEnd(); eTabs.moveNext())
	{
		var path = fsu.Resolve(eTabs.item().path);
		DOpus.SetClip(path);
	}
}
1 Like

The last script still doesn't work as expected.

The script...

The result...
2022-07-26_201026

It's possible the Windows clipboard history tool ignores rapid changes and only keeps the last one. I don't know how it works. You could try adding a delay between each path but that could make the thing quite slow. Maybe you're better off using one of the proper tools for this instead of trying to do it through the clipboard.

Ah, too bad. I think I need to find a 3rd app for this task or do it manually. Thank you very much for your reply, Leo.

It's the kind of thing that Quick Access Popup and the other tools mentioned in Can Opus replace the File Open/Save dialogs other programs use? should make very easy.

1 Like

A delay of 250 ms should be enough.

DOpus.Delay(250);

Thank for your reply lxp, but I have no idea where to put "DOpus.Delay(250);" in the script or which line should I change.

Insert a new line after DOpus.SetClip(path);.

function OnClick(clickData)
{
	var lister = clickData.func.sourcetab.lister;
	var fsu = DOpus.FSUtil;
	for (var eTabs = new Enumerator(lister.tabs); !eTabs.atEnd(); eTabs.moveNext())
	{
		var path = fsu.Resolve(eTabs.item().path);
		DOpus.SetClip(path);
        DOpus.Delay(250);
	}
}
2 Likes

Yes, insert a new line after DOpus.SetClip(path); works as expected. Many many thanks for your help, lxp. This helps me a lot. And thanks a lot for the script too, Leo.

The result is in the clipboard history...
2022-07-26_220559

Again, thanks a lot.