My camera has these two folders:
-100_PANA
-101_PANA
each containing both jpg-s and mov-s. On my computer, I have
images/
- -100_PANA
- -101_PANA
video/
- -100_PANA
- -101_PANA
What I'd like to do is drag-copy the folders from the camera to each place, but when I drag to "images", it only copies jpg-s, and only mov-s to "video". Is it possible to filter the files in a drag-and-drop this way?
As it stands, I have to manually do this in each folder, and the number of folders is just going to increase over time. It automatically creates new ones as they fill up (which is something like several hunded).
Drag and drop folders, but filter files therein?
-
- Posts: 261
- Joined: 02 Dec 2014 16:49
Drag and drop folders, but filter files therein?
Windows 8.1, 64-bit
-
- Posts: 261
- Joined: 02 Dec 2014 16:49
Re: Drag and drop folders, but filter files therein?
(How do I see folders when filtering? "Apply to files only (Find Files & Branch View - Visual Filters)" is checked, but I don't see them.)
Windows 8.1, 64-bit
Re: Drag and drop folders, but filter files therein?
Visual filters? Make sure you prefix "\|" in it. So let say you want to filter all jpg and png files but also want to see folders. You will be using:
It can actually be shorten to:
I always add *. to all extension out of habbit.
Anyway, the code for the drag and drop would be something like:
But basically, you manually put in the location of the photos and the videos folders in the $LocationPhotos and $LocationVideos. After that, you can just simply select a root folder you want to to the action on and it will then copy all photos into the location you set $LocationPhotos and move all video files into the location set by $LocationVideos. The script also allows you do select multiple folders so feel free to do so.
EDIT: I changed the code. It now supports drag and drop. Simply add a catalog item or custom toolbar button that load the script. Then you can drag all the folders onto the catalog item and it will automatically copy and move those files.
Code: Select all
\|*.jpg|*.png
Code: Select all
\|jpg|png
Anyway, the code for the drag and drop would be something like:
Code: Select all
$PatternPhotos = "*.jpg";
$PatternVideos = "*.mov";
$LocationPhotos = "E:\Desktop\TEST\Destination\Photos"; // Path to Photos
$LocationVideos = "E:\Desktop\TEST\Destination\Videos"; // Path to Videos
$Files = "";
If <get drop |> != "" {$SelectedItems = <get drop |>;}
Else {$SelectedItems = Get('SelectedItemsPathNames', '|', 'a');}
ForEach($Item, $SelectedItems, "|") {
If Exists($Item) == 2 {$Files = $Files."|".FolderReport("files", "r", $Item, "r", , "|")."|";}
ElseIf Exists($Item) == 1 {$Files = "$Files|$Item|"; } }
$Files = FormatList($Files, "tsed", "|");
$SourcePhotos = FormatList($Files,f,"|",$PatternPhotos);
$SourceVideos = FormatList($Files,f,"|",$PatternVideos);
If $SourcePhotos != "" {Copyto "$LocationPhotos", "$SourcePhotos", "", -1;}
If $SourceVideos != "" {Moveto "$LocationVideos", "$SourceVideos", "", -1;}
EDIT: I changed the code. It now supports drag and drop. Simply add a catalog item or custom toolbar button that load the script. Then you can drag all the folders onto the catalog item and it will automatically copy and move those files.