"Clipboard PASTE AS=ASK" issues

Hello again! o)

Could it be that the command "Clipboard PASTE AS=ASK", if run from a script command, behaves wrong at times?

  1. For regular file-items in the clipboard, the command above seems to prefer the current dest-tab to paste items if the dest-tab is a collection. So it's not always pasting into the source-tab as expected. It does paste into the source-tab though, if the dest-tab is empty/unset or a regular folder and not a collection. Regular items have been copied into clipboard by running "Clipboard COPY" before.

  2. If there is plain text in the clipboard and the dest-tab is a collection, nothing happens when running "Clipboard PASTE AS=ASK" in the source file display. The destination tab needs to be empty/unset or a regular folder to make the filename requester appear.

Always using dual lister here for both type of issues.
"Clipboard PASTE.." is triggered via file display background context menu respectively (which runs script command).

Thanks!

Hello! o)

I investigated some more and managed to put a little demo together.
I would be pleased if you give it a shot and see for yourself.

  • save this as ClipboardPasteInScriptCommandIssue.js in your script addins folder.
  • open a dual lister
  • make sure the source is showing a regular folder
  • make sure the destination is showing a file collection
  • copy a *.txt file from somewhere via right click context menu
  • run "ClipboardPasteInScriptCommandIssue" in the source

->> the file copied to clipboard will end up in the destination tab, whereas I expect it to go into the source
->> this is only if the destination is a collection

Thanks! o)

///////////////////////////////////////////////////////////////////////////////
function OnInit(data){
	data.name = "Command.Generic: ClipboardPasteInScriptCommandIssue";
	data.default_enable = true;
	var cmd = data.AddCommand();
    cmd.name = "ClipboardPasteInScriptCommandIssue";
    cmd.method = "Command_ClipboardPasteInScriptCommandIssue";
    cmd.label = "ClipboardPasteInScriptCommandIssue";
}

///////////////////////////////////////////////////////////////////////////////
function Command_ClipboardPasteInScriptCommandIssue(data) {
	Debug("ClipboardPasteInScriptCommandIssue():");
	Debug("    cmdline: "+data.cmdline);

	var cmd = data.func.command;

	cmd.SetQualifiers(data.func.qualifiers);

	Debug("    files# : " +cmd.files.count);
	Debug("    quals  : " +data.func.qualifiers);
	Debug("    source : " +cmd.sourcetab.path);
	Debug("    dest   : " +cmd.desttab.path);
	var result = cmd.RunCommand("Clipboard Paste");
	Debug("        result: " +result);
}
///////////////////////////////////////////////////////////////////////////////
function Debug(txt){
	if (1) DOpus.Output(txt); return;
}

This is not special to "Clipboard PASTE AS=ASK", the "AS=ASK" switch does not add to the problem.
A regular "PASTE" yields the same result. Just to clarify, since the initial post is about "PASTE AS=ASK..", ok? o)

Thanks for the report, this will be fixed in the next update.

Thanks for fixing! o)