Code: Select all
$root = <curpath>;
foreach($item, <get selecteditemspathnames>, <crlf>, ,) {
$folder = format(property("#3",$item), "yyyy-mm-dd---");
moveto $folder, $item,$root,2;
}
When I offload pictures from my various cameras, the pictures go into a folder so I can process them.
Then I want to run this script so I can basically sort and move the pictures into folders labeled by date.
This script basically sets a root variable (which is not really needed anymore but I used it while developing this script).
Then the script creates a list of files that are selected.
Then the script goes through the list and extracts the modified date from the current file, then formats this as year-month-day---.
Then the currently processing file is moved into the date folder. If the folder does not exists, it is autocreated without prompting.
When I run this it seems to work fine but the copy process seems to get stuck. All the files seem to get moved into the folders but down in the XY status bar the little background process indicator flashes between diagonal lines, a C, and an N.
When I click on the flashing icon I get the background jobs dialog and several of the move jobs seem to be stuck as "in progress since ...". If I open task manager there are several copies of xycopy.exe running.
If I wait then never seem to go away. I basically need to kill the processes to 'unstuck' them.
Every time I run this different files and a different number of files, or the move processes, seem to get stuck so there is no pattern.
I have tried this on different files, as it will work on anything not just pictures, and I still get the problem. I also dont get the problem every time. It seems to happen on larger selections of files.
I have also tried this on my computer and on my work computer with the same results.
Any help or suggestions with my script will be much appreciated.
XYplorer Beta Club