Quick buttons for directory organisation

Leo, I am answering here still because I think it makes more sense. I hope this is OK -- see below:

I now use a button that does

Copy TO "C:\Users\matthiasernst\Downloads" MOVE

and it works exactly as I want. I hope it's the correct solution.

I am now quoting the above message of user "aussieboykie" because I think there is some problems there which confused me.
First of all, as mentioned by Jon, RENAMEWHENSAME is a bit confusing because it does NOT refer to supression of the rename dialogue (making it automatic). It's idea is to address the situation where you copy a file to the same folder with the intention of creating a copy within the same folder, where a prompt makes no sense. However, MOVING a file within the same folder makes no sense -- indeed, you get an error message. Thus I believe (?) RENAMEWHENSAME only makes sense in combination with COPY that does NOT have a MOVE action specified -- and thus user aussieboykie might not have understood the command?

WHENEXISTS=rename may be what you want instead of RENAMEWHENSAME.

Not sure which message/comment by Jon you're referring to, though. He hasn't posted in this thread or the other one you linked to.

This thread is very difficult to follow with so many unrelated questions under it, which is why a new thread would be better. (You can always put a link to it here if you think it would be useful for other people.)

Very useful functions (for me) that I think Dopus should have built in...
Move Here to New Subfolder:

function OnClick(clickData)
	var cmd = clickData.func.command;
	var tab = clickData.func.sourcetab;
	if (clickData.func.sourcetab.selected.count == 0)
		cmd.RunCommand('CreateFolder READAUTO=no');
	var focusI = tab.GetFocusItem.name_stem;                                          //Get the base name of the item in focus
    for(var e = new Enumerator(clickData.func.sourcetab.selected); !e.atEnd(); e.moveNext()) {   //Each item
	if(focusI == e.item().name_stem) {var icase = 1; break;}                          //If the focused item is in the selected items, set icase to 1 and exit the loop
	if(icase != 1) {var focusI = tab.selected(0).name_stem;}                          //If the focused item is not in the selected items, set focusI equal to the base name of the first item in the selected items
	cmd.AddLine('@set dir={dlgstrings|Enter new subfolder name|"' + focusI + '"}');   //Use the base name of the item to create the folder
	cmd.AddLine('Copy MOVE HERE CREATEFOLDER="{$dir}"');                              //Create a folder and move the selected items into it

Paste Here to New Subfolder

What confuses me even more is that searched the help documents and forums can't find this type of input and drop down window script parameter:

is there any way to get the first one to work in 2 pane mode? bc when you have something selected in pane 1 and hit the button in pane 2, it just makes an empty folder.

1 Like

If you want to select files on one side and more them into a new sub-folder on the other side:


Run the button from the side with the selected files, not the side you want them to go into.

Sweet that worked perfectly, thank you!

Move Here to New Subfolder (JS) v1.5:
Move Here to New Subfolder (JS) v1.5.txt (3.3 KB)
dlg.Control("static3").label = "D:\\Icons\\XYplorer Pane C-M MOVE.png"; // Icon

User-defined command:movehere-sf
Move Here to New Subfolder v1.5.osp (7.7 KB)
Move Here to New Subfolder.dcf (278 Bytes)

You don't need a script to do that. You can do it in one line:

  • Drop down list of item names. . .