Thank you.
With a reference in this forum I managed to add the /n switch:
Code: Select all
$files = listfolder(<newpath>, , 1, <crlf>);
$cntFiles = gettoken($files, "count", <crlf>);
$images = quicksearch("{:Image} /n", $files);
$cntImages = gettoken($images, "count", <crlf>);
if ($cntFiles) {
$percent = $cntImages / $cntFiles;
if ($percent >= 0.75) {
if (get("view") != 9) { #314; } // Large Tiles view
} else {
if (get("view") != 0) { #302; } // Details view
}
}
I guess the problem is that the script counts only images and files and not folders. And if there are no images and no files it does nothing.
So I would have to change the script that it counts also folders - Or that it changes back to details if there are only folders. Right?
EDIT:
Code: Select all
$files = listfolder(<newpath>, , 1, <crlf>);
$cntFiles = gettoken($files, "count", <crlf>);
$images = quicksearch("{:Image} /n", $files);
$cntImages = gettoken($images, "count", <crlf>);
if ($cntFiles) {
$percent = $cntImages / $cntFiles;
if ($percent >= 0.75) {
if (get("view") != 9) { #314; } // Large Tiles view
} else {
if (get("view") != 0) { #302; } // Details view
}
}
else {
if (get("view") != 0) { #302; } // Details view
}
But I still get an error message regarding the bluray device when I open "this computer", because this search area is not available. beside I do not open it. I thought subfolders are ignored now?