Page 1 of 1

Move selected file(s) to the currently highlighted folder in other pane

Posted: 06 May 2022 19:18
by juswannalearn
Is this possible with a script?

I have lots of files I want to organise into existing subfolders, but I don't wish to navigate into and out of each subfolder in the opposite pane during each move operation.

I want to simply highlight the folder in the opposite pane that I want to move files to (without opening it), and move the highlighted files into it on a command. Ideally with a custom shortcut key.

As an additional enhancement - if multiple folders are selected/highlighted, then move the selected files to each (i.e. creating copies as required).

Many thanks for your help in advance!

Re: Move selected file(s) to the currently highlighted folder in other pane

Posted: 06 May 2022 19:38
by highend

Code: Select all

    foreach($folder, <get SelectedItemsPathNames <crlf> i>, <crlf>, "e") {
        if (exists($folder) == 2) { copyto $folder, 4:=2, 11:=0; }
    }

Re: Move selected file(s) to the currently highlighted folder in other pane

Posted: 06 May 2022 19:55
by juswannalearn
Wow thank you that's amazing! Much appreciated.

Re: Move selected file(s) to the currently highlighted folder in other pane

Posted: 06 May 2022 20:01
by juswannalearn
Is there a way to adapt this so that if a single folder is selected, files are MOVED rather than copied into that location?

Re: Move selected file(s) to the currently highlighted folder in other pane

Posted: 06 May 2022 20:05
by highend

Code: Select all

    $dstFolders = <get SelectedItemsPathNames <crlf> i>;
    if (gettoken($dstFolders, "count", <crlf>) == 1) {
        if (exists($dstFolders) == 2) { moveto $dstFolders, 4:=2, 11:=0; }
    } else {
        foreach($folder, $dstFolders, <crlf>, "e") {
            if (exists($folder) == 2) { copyto $folder, 4:=2, 11:=0; }
        }
    }
?

Re: Move selected file(s) to the currently highlighted folder in other pane

Posted: 06 May 2022 20:37
by juswannalearn
Amazing, thank you, I will test it out over the weekend.