LOADSEARCH with == should be changed
Moderators: Hacker, petermad, Stefan2, white
LOADSEARCH with == should be changed
I have a command sequence searching for folders by a saved preset, then selecting all results and deleting them. Usually, it works perfectly, but if nothing found, Total Commander doesn't output search results to a panel, and when I close the search window, it selects all in the current directory and suggests removing it. That's a dangerous behavior. Maybe it can be somehow changed? As a user, I expect the command sequence to stop after an unsuccessful search.
Re: LOADSEARCH with == should be changed
There is no such thing as an unsuccessful search for TC!
Hoecker sie sind raus!
Re: LOADSEARCH with == should be changed
2Gxost
It would be great if you could share over here the command sequence you were using.
Otherwise, identifying the issue you are dealing with becomes pretty complicated.
It would be great if you could share over here the command sequence you were using.
Otherwise, identifying the issue you are dealing with becomes pretty complicated.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10/15
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10/15
Re: LOADSEARCH with == should be changed
Easy. My command:
Where em_FindBinariesAndObjects:
I want my command to stop after em_FindBinariesAndObjects if nothing found because all consequent commands have no sense.
Code: Select all
em_FindBinariesAndObjects,cm_SelectAllFolders,cm_Delete
Code: Select all
LOADSEARCH ==Binaries and objects
Re: LOADSEARCH with == should be changed
2Gxost
Try.
Command:
em_command:
Try.
Command:
Code: Select all
cm_RereadSource,em_cd_Clear,em_FindBinariesAndObjects,cm_SelectAllFolders,cm_Delete,cm_RereadSource,cm_SrcAllFiles
Code: Select all
[em_cd_Clear]
cmd=cd |* *\
Last edited by sa16 on 2024-12-17, 15:14 UTC, edited 1 time in total.
Re: LOADSEARCH with == should be changed
2Gxost
I have recreated your sequence (in a contracted form, though, since the first two commands are sufficient to understand the issue).
I can confirm, the sequence "em_findFolders(cmd>LOADSEARCH==valid_saved_search_for_directories),cm_SelectAllFolders" behaves exactly as you explained it in the first message here.
I also tried to put it that way "em_findFolders(cmd>LOADSEARCH==valid_saved_search_for_directories),em_selectFolders(cmd>selectfilesD)" to see if it could make any difference, but somehow it didn't work for me at all (selectfilesD just didn't select directories in my case).
For sure, in this use case, it would be great to have in hand something like those commonly known logical operators:
'&&' run [second command] if the preceding command succeeded.
';' run unconditionally (which in TotalCommander is ',')
'||' run if the preceding command failed.
'&' run both commands in parallel...
By the way, the sequence offered by sa16 (cm_RereadSource,em_cd_Clear,em_Find...,cm_SelectAllFolders,cd "*.*") worked for me as intended.
I have recreated your sequence (in a contracted form, though, since the first two commands are sufficient to understand the issue).
I can confirm, the sequence "em_findFolders(cmd>LOADSEARCH==valid_saved_search_for_directories),cm_SelectAllFolders" behaves exactly as you explained it in the first message here.
I also tried to put it that way "em_findFolders(cmd>LOADSEARCH==valid_saved_search_for_directories),em_selectFolders(cmd>selectfilesD)" to see if it could make any difference, but somehow it didn't work for me at all (selectfilesD just didn't select directories in my case).
For sure, in this use case, it would be great to have in hand something like those commonly known logical operators:
'&&' run [second command] if the preceding command succeeded.
';' run unconditionally (which in TotalCommander is ',')
'||' run if the preceding command failed.
'&' run both commands in parallel...
By the way, the sequence offered by sa16 (cm_RereadSource,em_cd_Clear,em_Find...,cm_SelectAllFolders,cd "*.*") worked for me as intended.
Last edited by beb on 2024-12-18, 09:11 UTC, edited 1 time in total.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10/15
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10/15
Re: LOADSEARCH with == should be changed
2Gxost
The chain works normally starting from TC 11.02.
In an older version, the last cd "*. *" command must be issued via em_command, it is even more correct to replace it with cm_SrcAllFiles.
Replaced in the original post.
The chain works normally starting from TC 11.02.
In an older version, the last cd "*. *" command must be issued via em_command, it is even more correct to replace it with cm_SrcAllFiles.
Replaced in the original post.
Re: LOADSEARCH with == should be changed
Thank you, my command sequence works even better than before and is more safe now.
Regarding LOADSEARCH I'm still thinking it would be better if there was a way to just abort the command chain. Combined with the improved command sequence, it would work ideal.
Regarding LOADSEARCH I'm still thinking it would be better if there was a way to just abort the command chain. Combined with the improved command sequence, it would work ideal.
Re: LOADSEARCH with == should be changed
And you still ignore the fact that even a search with zero results is a SUCCESSFUL search.Gxost wrote: 2024-12-17, 16:47 UTC Regarding LOADSEARCH I'm still thinking it would be better if there was a way to just abort the command chain. Combined with the improved command sequence, it would work ideal.
Hoecker sie sind raus!
Re: LOADSEARCH with == should be changed
2Sir_SiLvA
Ok, then let's call it "search without results". If nothing is found, then nothing to do with results, right?
Ok, then let's call it "search without results". If nothing is found, then nothing to do with results, right?
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: LOADSEARCH with == should be changed
OK, I will transfer empty results to the active panel when nothing is found with LOADSEARCH ==saved_search.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: LOADSEARCH with == should be changed
Confirmed implemented in TC 11.50rc3history.txt wrote:18.12.24 Fixed: LOADSEARCH: When launched with parameter ==saved_search and nothing is found, transfer empty results to active panel (32/64)

License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: LOADSEARCH with == should be changed
In its turn, I can confirm that the command sequence in question now works as intended:
em_findFolders,cm_SelectAllFolders,cm_Delete
where: em_findFolders is "cmd=LOADSEARCH==valid_saved_search_for_directories"
If em_findFolders finds nothing, a user just gets an empty active panel, therefore cm_SelectAllFolders has nothing to select, and cm_Delete has nothing to delete. I.e, the sequence effectively stops when the em_findFolders returns no results.
Gxost's original command sequence now becomes safe out-of-the box, workarounds no longer needed.
Note.
I also figured out why the above was the case.beb wrote: 2024-12-17, 12:46 UTC ...em_selectFolders(cmd>selectfilesD)... (selectfilesD just didn't select directories in my case).
My command was:
Code: Select all
[em_selectFolders]
cmd=selectfilesD
Code: Select all
[em_selectFolders]
cmd=selectfilesD *.*
Code: Select all
[em_selectFolders]
cmd=selectfilesD *
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10/15
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10/15
Re: LOADSEARCH with == should be changed
In an empty search results window, I noticed such a feature or bug.
If you return to such a tab with search results from another tab (in any file panel) and call the search (Alt+F7) again, then it will be performed in the folder corresponding to the previous tab (or in the TC folder, if you return, for example, from the browser)!
The same behavior is observed in other versions of TC (not only 10.50).
If you return to such a tab with search results from another tab (in any file panel) and call the search (Alt+F7) again, then it will be performed in the folder corresponding to the previous tab (or in the TC folder, if you return, for example, from the browser)!
The same behavior is observed in other versions of TC (not only 10.50).
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: LOADSEARCH with == should be changed
There is no path to return to with an empty list.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com