Question about XCopy from Script
Posted: 31 May 2020 14:48
Good morning all,
I have a small script that is loaded/run via the hamburger menu after I select files in the file list :
I can select multiple files in a folder and they are moved into a folder that matches the name. For example, I select the "April Fool's Day (1986).mkv" file and it is moved into the "April Fool's Day (1986)" folder.
Script works fine with just one problem. When I do select multiple files, I get multiple copies of XCopy (so multiple overwrite prompts, etc.) instead of all them being added to a single XCopy queue (like it would do if I manually did any file operations). I like the prompt and didn't script the automatic overwrite option, but now I have to click through multiple XCopy windows.
Here is the script, is there a problem with the coding ?
I have a small script that is loaded/run via the hamburger menu after I select files in the file list :
Code: Select all
::Move File to Folder;load "MoveFileToFolder.xys";
Script works fine with just one problem. When I do select multiple files, I get multiple copies of XCopy (so multiple overwrite prompts, etc.) instead of all them being added to a single XCopy queue (like it would do if I manually did any file operations). I like the prompt and didn't script the automatic overwrite option, but now I have to click through multiple XCopy windows.
Here is the script, is there a problem with the coding ?
Code: Select all
foreach($item, <get SelectedItemsPathNames |>) {
$base = gpc($item, "base");
$ext = gpc($item, "ext");
$folder = $base;
moveto "<curpath>\$folder", $item, , 2;
}