Aha! Assuming that most of the time I'd type a part of a name is where the issue is. I wouldn't, simple as that. You've no idea how many times I've wanted to pull my hair out when searching and finding partial matches, but not exact ones as a result of the default action.. I guess it's partially intuitive
Also, I've reconstructed my older script to follow the pattern of the one that you suggested, but now it does not move the files to their destinations. I stepped through it and it gets as far as the match of pattern and recognises where to move, but doesn't get to the bottom of the script to actually move the files. Here it is in full:
Code: Select all
"New Moving Script"
$filelist = getinfo('SelectedItemsPathNames', '|');
$p = strpos($filelist, '|');
while ($p >= 0)
{
$file = substr($filelist, 0, $p);
$name = regexreplace($file, "^.+\\(.+)$", "$1");
$filelist = substr($filelist, $p + 1);
$p = strpos($filelist, '|');
//
$dest = FALSE;
if (strpos($name, '.720p.HDTV.') > -1)
{
$dest = 'D:\Video\TV 720p\';
}
elseif (strpos($name, 'CSI.S10') > -1)
{
$dest = 'D:\Video\CSI Las Vegas\';
}
elseif (strpos($name, 'Smallville') > -1)
{
$dest = 'D:\Video\Smallville\';
}
elseif (strpos($name, 'The.Office') > -1)
{
$dest = 'D:\Video\USTV\';
}
elseif (strpos($name, 'Supernatural.') > -1)
{
$dest = 'D:\Video\USTV\';
}
elseif (strpos($name, 'Greys.Anatomy') > -1)
{
$dest = 'D:\Video\USTV\';
}
elseif (strpos($name, '90210.S02') > -1)
{
$dest = 'D:\Video\90210\';
}
elseif (strpos($name, 'American.Dad') > -1)
{
$dest = 'D:\Video\American Dad\';
}
elseif (strpos($name, 'The.Big.Bang.Theory') > -1)
{
$dest = 'D:\Video\The Big Bang Theory\';
}
elseif (strpos($name, 'CSI.Miami') > -1)
{
$dest = 'D:\Video\CSI Miami\';
}
elseif (strpos($name, 'CSI.NY.') > -1)
{
$dest = 'D:\Video\CSI NY\';
}
elseif (strpos($name, 'CSI.New.York') > -1)
{
$dest = 'D:\Video\CSI NY\';
}
elseif (strpos($name, 'Daily.Show') > -1)
{
$dest = 'D:\Video\Daily Show\';
}
elseif (strpos($name, 'Family.Guy') > -1)
{
$dest = 'D:\Video\Family Guy\';
}
elseif (strpos($name, 'Fringe.') > -1)
{
$dest = 'D:\Video\Fringe\';
}
elseif (strpos($name, 'Gossip.Girl') > -1)
{
$dest = 'D:\Video\Gossip Girl\';
}
elseif (strpos($name, 'Heroes.') > -1)
{
$dest = 'D:\Video\Heroes\';
}
elseif (strpos($name, 'House.') > -1)
{
$dest = 'D:\Video\House\';
}
elseif (strpos($name, 'Jay.Leno') > -1)
{
$dest = 'D:\Video\Jay.Leno\';
}
elseif (strpos($name, 'Law.and.Order.SVU') > -1)
{
$dest = 'D:\Video\LaO SVU\';
}
elseif (strpos($name, 'NCIS') > -1)
{
$dest = 'D:\Video\USTV\';
}
elseif (strpos($name, 'One.Tree.Hill') > -1)
{
$dest = 'D:\Video\USTV\';
}
elseif (strpos($name, 'The.Mentalist') > -1)
{
$dest = 'D:\Video\USTV\';
}
elseif (strpos($name, 'The.SImpsons') > -1)
{
$dest = 'D:\Video\The Simpsons\';
}
elseif (strpos($name, 'Law.and.Order.S') > -1)
{
$dest = 'D:\Video\LaO\';
}
elseif (strpos($name, 'Desperate.Housewives') > -1)
{
$dest = 'D:\Video\Desperate.Housewives\';
}
elseif (strpos($name, 'How.I.Met.Your.Mother') > -1)
{
$dest = 'D:\Video\How I Met Your Mother\';
}
elseif (strpos($name, 'Hells.https://www.xyplorer.com.US.') > -1)
{
$dest = 'D:\Video\Hell'https://www.xyplorer.com\';
}
elseif (strpos($name, 'Flashpoint.') > -1)
{
$dest = 'D:\Video\USTV\';
}
elseif (strpos($name, 'South.Park') > -1)
{
$dest = 'D:\Video\South Park\';
}
elseif (strpos($name, 'Cops.') > -1)
{
$dest = 'D:\Video\Cops\';
}
elseif (strpos($name, 'Dollhouse.') > -1)
{
$dest = 'D:\Video\USTV\';
}
if (FALSE != $dest)
{
moveto $dest, $file;
}