Page 1 of 1

Pull video files from folders

Posted: 05 Mar 2014 13:01
by Dan Panke
This script will pull video files out of selected folders and move them up a level in the tree.

Code: Select all

$a = get("SelectedItemsPathNames", "|");
 foreach($b, $a, "|") {
 $c = folderreport("files", "r", $b, "r", , "|");
 if(strpos($c, ".avi", , 0) != -1) { moveto "<curpath>", "$b\*.avi", , 1; }
 if(strpos($c, ".mp4", , 0) != -1) { moveto "<curpath>", "$b\*.mp4", , 1; }
 if(strpos($c, ".mkv", , 0) != -1) { moveto "<curpath>", "$b\*.mkv", , 1; }
 if(strpos($c, ".mpg", , 0) != -1) { moveto "<curpath>", "$b\*.mpg", , 1; }
 if(strpos($c, ".mpeg", , 0) != -1) { moveto "<curpath>", "$b\*.mpeg", , 1; }
 }
 msg "Done!";

Re: Pull video files from folders

Posted: 26 Mar 2014 00:15
by Enternal
Oh this is pretty nifty! Although personally I would be too lazy to sit and write, debug, and test that code when I would just simply do a search for all those files and then cut and paste. "So easy that a cave man could do it!" :lol:

Anyway thanks!