How to Force Quicksearch() include zero level folders?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
eil
Posts: 1923
Joined: 13 Jan 2011 19:44

How to Force Quicksearch() include zero level folders?

Post by eil »

I'm definitely dumb, as whatever i do i can't make Quicksearch() to make search among 0 level folders, it just skips them and goes in subs. The most irritating thing is that i could imagine that this is due to "over-smart" logic when only folders are selected(maybe those are considered as only a path markers), but even if i select some files and folders, Quicksearch() checks 0 level files and finds everything in subs, still skipping 0 level folders. :veryconfused:
example code i was experimenting:(i specifically leave commented variants i tried too)

Code: Select all

  $selItems = <get SelectedItemsPathNamesSlashed |>;
  $selItems = replace($selItems, "|", ";");
  //$selItems =   $selItems . ";" . quicksearch("* /d", "$selItems", ";");
  //$tags = quicksearch("tags:* /n /maxdepth=0", $selItems,"f") . ";" . quicksearch("tags:*", "$selItems", ";");
  $tags = quicksearch("tags:* /t", "$selItems", ";");
items structure:

Code: Select all

folder1
file1
file2 - labeled = found
folder2 - labeled = !not found
    folder21 - labeled = found
    folder22
        file221 - labeled = found
folder3 - labeled = !not found
Win 7 SP1 x64 100% 1366x768|1900x1080

highend
Posts: 15016
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: How to Force Quicksearch() include zero level folders?

Post by highend »

? It's totally normal that quicksearch doesn't list the folders itself in a multi-path only scenario.

Your structure example looks at least incomplete...

Code: Select all

    $selItems = <get SelectedItemsPathNamesSlashed <crlf>>;
    $result   = "";
    foreach($selItem, $selItems, <crlf>, "e") {
        $result .= $selItem . <crlf> . quicksearch(, $selItem) . <crlf>;
    }
    $result = formatlist($result, "e", <crlf>);
    text $result;
One of my scripts helped you out? Please donate via Paypal

eil
Posts: 1923
Joined: 13 Jan 2011 19:44

Re: How to Force Quicksearch() include zero level folders?

Post by eil »

highend wrote: ↑27 Jan 2021 15:19 ? It's totally normal that quicksearch doesn't list the folders itself in a multi-path only scenario.
so as i understand i was right and there is totally no way to give qiucksearch() a list of mixed items and make it search only among those.
from user perspective it feels quite strange: there are at least 2 settings for this command(/n, /maxdepth=) that one would expect to have some influence on such situation, while they not. guess will make another wish.. :ninja:
Last edited by eil on 27 Jan 2021 18:25, edited 2 times in total.
Win 7 SP1 x64 100% 1366x768|1900x1080

highend
Posts: 15016
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: How to Force Quicksearch() include zero level folders?

Post by highend »

Mixed items are fine, I talked about multi-path only selections...

Apart from that, the gui does the same and quicksearch() just "imitates" it...
One of my scripts helped you out? Please donate via Paypal

eil
Posts: 1923
Joined: 13 Jan 2011 19:44

Re: How to Force Quicksearch() include zero level folders?

Post by eil »

highend wrote: ↑27 Jan 2021 17:39 Mixed items are fine, I talked about multi-path only selections...

Apart from that, the gui does the same and quicksearch() just "imitates" it...
but it's not fine, quicksearch works quite unpredictable for me.. :veryconfused:

here's structure i use for experiment with selection(all selected items are on same level)
2021-01-27_202110.png
each time same script only search pattern changed:
searching "t" in name = 0 level included and found

Code: Select all

  $selItems = <get SelectedItemsPathNamesSlashed |>;
  $tags = quicksearch("*t*", "$selItems", "<crlf>");
  echo $tags;
2021-01-27_202724.png
searching "i" in name = 0 zero level included and found

Code: Select all

  $selItems = <get SelectedItemsPathNamesSlashed |>;
  $tags = quicksearch("*i*", "$selItems", "<crlf>");
  echo $tags;
2021-01-27_202651.png
searching tagged(tags:*) items = 0 level folders skipped

Code: Select all

  $selItems = <get SelectedItemsPathNamesSlashed |>;
  $tags = quicksearch("tags:*", "$selItems", "<crlf>");
  echo $tags;
2021-01-27_203226.png

:!: yet it's truly strange logic that if i select 100 folders, i can't search among them itself(0 level) as it's multi-location-search, but if i simply add 1 file to this list - 0 level folders are in search results(at least for names). :|
To see the attached files, you need to log into the forum.
Win 7 SP1 x64 100% 1366x768|1900x1080

Post Reply