Thanks Wims! I never even thought of the fact that I could use an alias on the identifier when I read it in the help files. I guess it's my lack of experience
I noticed something about it though, and this is from my original code:
echo -ag %f
echo -ag test $+ %f
Would return
Tokyo Ghoul
test Tokyo Ghoul
So I replaced spaces with _ to see if I had a space in the beginning:
_Tokyo_Ghoul
test_Tokyo_Ghoul
Took me a while to figure out why I was getting a path with a space in the beginning, but as soon as I did it was an easy fix
I believe it was cause the files look like [HorribleSubs] Anime name, and I removed the [HorribleSubs], leaving a space behind.
alias FolderSort {
var %main H:\Anime\
noop $findfile(%main,*.mkv,0,0, noop $handle_anime(%main,$nopath($1-)))
}
alias handle_anime {
var %pattern /(\[HorribleSubs\] .+ -)/iS
if ($regex($2-,%pattern)) {
var %f $remove($regml(1),-,[HorribleSubs] )
var %f $mid(%f,2-)
if (!$isdir($1 $+ %f)) {
echo 4 -ag I had to make a new folder for %f $+ .
mkdir $qt($1 $+ %f)
}
else {
rename $qt($1 $+ $2-) $qt($1 $+ %f $+ \ $+ $2-)
echo 3 -ag Moved %f without a problem.
}
}
}