Thank you, it was a dumb mistake, and finally I was able to fulfill my task.
I don't know whether it will be useful for anybody (selection of folders based on filetypes they contain), but I will just put the script here.
@var $file = FindFiles("D:\some\path\\*");
@var $n;
for( $n = 0; $n < arrayCount($file); $n++)
{
@var $is = IsFolder($file[$n]);
if($is == 1)
{
@var $inlsdfiles = FindFiles($file[$n] ^ "*.lsd");
@var $indslfiles = FindFiles($file[$n] ^ "*.dsl");
if(arrayCount($inlsdfiles) > 0)
{
@var $arr[] = PathGetParts($file[$n]);
@var $path[] = {};
arrayAdd($path, $arr[2]);
@var $num = SetSourceSelected($path, 0);
}
if(arrayCount($indslfiles) > 0)
{
@var $arr[] = PathGetParts($file[$n]);
@var $path[] = {};
arrayAdd($path, $arr[2]);
@var $num = SetSourceSelected($path, 0);
}
}
}
Maybe, it could be done in a more beautiful way, but the clumsiness of this script language reads off the scale. I had a choice between Batch script, Bash script and Your script during evaluating this task, and I assume, I made the wrong choice