Paste at selected location in expandable folders

Here's the same command but converted into a script.

This should solve the problems discussed in Clipboard PASTE fails with CUT/PASTE when setting TO= directory to subdirectory

Here's a .dcf file you can drag to a toolbar:

Here's the code inside the .dcf file, to show how it works:

function OnClick(clickData)
{
	var tab = clickData.func.sourcetab;
	var cmd = clickData.func.command;

	if (tab.selected_dirs.count == 1)
	{
		cmd.RunCommand('Go EXPANDBRANCH');
		cmd.SetSource(tab.selected_dirs(0));
	}
	else if (tab.selected_files.count == 1)
	{
		cmd.SetSource(tab.selected_files(0).path);
	}

	cmd.ClearFiles();
	cmd.RunCommand('Clipboard PASTE COPYCOMMANDARGS="UPDATESECURITY=YES"');
}
3 Likes