How to make the number of levels in Find Files persistent

English support forum

Moderators: white, Hacker, petermad, Stefan2

mmm
Member
Member
Posts: 120
Joined: 2020-08-10, 12:32 UTC

How to make the number of levels in Find Files persistent

Post by *mmm »

Try as I may I cannot figure out how to make Find Files - Search in subdirectories - Number of levels option persistent throughout a TC session.
Many thanks.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6480
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: How to make the number of levels in Find Files persistent

Post by *Horst.Epp »

Make your settings and the use Load/Save tab to store them under a name.
Later you can load this saved setting
or make a button with the LOADSEARCH command to load it
LOADSEARCH your_saved_search
Windows 11 Home x64 Version 23H2 (OS Build 22631.3447)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
mmm
Member
Member
Posts: 120
Joined: 2020-08-10, 12:32 UTC

Re: How to make the number of levels in Find Files persistent

Post by *mmm »

Thanx a lot for your immediate reply.


When I switch panes, Alt+F7 opens with All (Unlimited depth) again.
Is that intentional ?
If yes, then the Save/Load feature is useless for me as I need to search a limited number of levels throughout the entire day.


What am I doing wrong?
User avatar
Stefan2
Power Member
Power Member
Posts: 4153
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: How to make the number of levels in Find Files persistent

Post by *Stefan2 »

mmm wrote: 2022-06-22, 10:47 UTC

What am I doing wrong?


Do an additionally step.

Create a user defined command from the above, next you can map Alt+F7 to execute that UDC





usercmd.ini:
[em_MySearchSettings]
CMD=LOADSEARCH search_MySavedSearchSetting

Now assign a keyboard shortcut at Misc. to your new command: em_MySearchSettings
You can use the original shortcut to open the search or another key combination you want.
For more see >>> https://ghisler.ch/board/viewtopic.php?p=390483#p390483






 
mmm
Member
Member
Posts: 120
Joined: 2020-08-10, 12:32 UTC

Re: How to make the number of levels in Find Files persistent

Post by *mmm »

Interesting. Thx.
With that approach, I think I would need to maintain several commands for each number of levels required.

I do not mind making one-time settings when launching TC in the morning. What I do mind though is having to spill tons of user commands all over the floor.

Am I the only one in this universe who would be perfectly happy with a simple mode in which Find files settings /i.e. the number of levels and Find text options, in particular/ would be persistent until next user change?

There is no doubt the concept you presented is extremely powerful for numerous types of jobs, yet I am convinced that persistency during a TC session might be beneficial/convenient for some.

I would like your opinion.
User avatar
Stefan2
Power Member
Power Member
Posts: 4153
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: How to make the number of levels in Find Files persistent

Post by *Stefan2 »

mmm wrote: 2022-06-22, 12:09 UTC

Am I the only one in this universe


Probably not, but TC is all in for safety (TC is used in many companies), and all to easy one could forget that a special setting was made in the morning
which is not remembered at afternoon and so the search result is not the real thing and can led to unfortunate mistakes.

If you going to make this persistent settings on your own by the above shown steps, that is your own issue, but nothing one could blame TC for.



Example?

08:00 I search at top level only for a project description > "2 level" ++ set "[x]use as default" as it is totally clear I will need that for the whole day.

15:00 I get a call to urgently cleanup the share now! and so have to check folders if save to delete them
and so I search at all sub folders (what I think I do) for any left over "todo" file, but forget the set persistent check mark. Boom.


 
User avatar
Hacker
Moderator
Moderator
Posts: 13061
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: How to make the number of levels in Find Files persistent

Post by *Hacker »

mmm,
If you don't mind using AutoHotkey, here is a short script that upon pressing Alt-F7 waits for the Find Files window and sets the depth to whatever is written in the file Depth.txt, so, you just write the number like "3" without quotes into Depth.txt and have the script running.

Code: Select all

~!F7::
	FileRead, Depth, Depth.txt
	WinWaitActive, ahk_class TFindFile
	Control, ChooseString, %Depth%%A_Space%, LCLComboBox1
	Control, ChooseString, %Depth%%A_Space%, TMyComboBox1
Return
HTH
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
mmm
Member
Member
Posts: 120
Joined: 2020-08-10, 12:32 UTC

Re: How to make the number of levels in Find Files persistent

Post by *mmm »

To Stephan2:
I see your point. With all due respect I disagree.
If your folks turn off spell-checker in the morning when writing a private letter about their company to their friend, then they are bound to send a business letter full of F-words to their boss in the afternoon and nobody can do anything about it.
No biggie though. I may submit an enhancement request in the future; need to talk to my team mates first.

To Roman:
Impressive implementation I must say. However, I wouldn't want to fiddle with an external TXT file at work as I have to make hundreds of searches per day. Put another, I consider your script a workaround, not a solution. Will use the code in a different situation though. Thanks for sharing.
User avatar
Hacker
Moderator
Moderator
Posts: 13061
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: How to make the number of levels in Find Files persistent

Post by *Hacker »

mmm,
As I understood it, you only want to set the depth once per day, so you only need to edit the file once in the morning. I thought this would suit you. If it does not, I can easily modify the script so that when the Find Files window appears, the first number you press, e.g. "7", sets the search depth to that number. Not sure if this would help in any way, though, as it would require you to always press that number. Or there could be a timeout, such as if you don't press a number within two seconds, the previous search depth will be used.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
Hacker
Moderator
Moderator
Posts: 13061
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: How to make the number of levels in Find Files persistent

Post by *Hacker »

mmm,
Here is a script that takes the last used value from Depth.txt, but you have one second to change it to something else and make it the new default value. Works only with values up to 9, though.

Code: Select all

SetWorkingDir, %A_ScriptDir%

#IFWinActive, ahk_class TTOTAL_CMD
~!F7::
	WinWaitActive, ahk_class TFindFile
	Sleep, 100
	If FileExist("Depth.txt")
	{
		FileRead, PreviousDepth, Depth.txt
		Control, ChooseString, %PreviousDepth%%A_Space%, LCLComboBox1
		Control, ChooseString, %PreviousDepth%%A_Space%, TMyComboBox1
	}

	Input, Depth, L1 T1, {Esc}, 1,2,3,4,5,6,7,8,9
	If (ErrorLevel = "Match" && Depth != PreviousDepth)
	{
		Control, ChooseString, %Depth%%A_Space%, LCLComboBox1
		Control, ChooseString, %Depth%%A_Space%, TMyComboBox1
		FileDelete, Depth.txt
		FileAppend, %Depth%, Depth.txt
	}
Return
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
mmm
Member
Member
Posts: 120
Joined: 2020-08-10, 12:32 UTC

Re: How to make the number of levels in Find Files persistent

Post by *mmm »

you only want to set the depth once per day,
Nope. I need to toy with the depth now and then during the work day.
Here is a script that takes ...
However I find your scripting skills absolutely astonishing, I am not leaning towards this approach. Thinking about a clean solution in GUI available for all TC users - if they are interested.
TC is all in for safety (TC is used in many companies), and all to easy one could forget that a special setting was made in the morning
I found out that most options in Find files ARE persistent; not only throughout a TC session but they remain persistent even after TC exit. /Search archives, Find text panel/. I have to admit I did not know that until now.

I think I understand reasons why the search depth option /aka levels/ was left out. When set hastily by a fresh user, it may lead to outstanding issues with search results. Please allow some time to think about a safe and robust implementation of the persistency in question.

On a side note - now that I know most Find files options are persistent, how can I go back to default settings upon a single click?

Many thanks to Bratislava,
mmm
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6480
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: How to make the number of levels in Find Files persistent

Post by *Horst.Epp »

One solution is to use an Everything search in which you can control the depth.
The result can be feed to a file list in TC using our AHK script "Open Everything GUI results with TC LOADLIST".
viewtopic.php?t=75439&hilit=everything+file+list

Also you can make an Everything search from TC search with the ev: or ed: prefixes
and the additional Everything parameters for setting the depth,
Last edited by Horst.Epp on 2022-06-23, 13:55 UTC, edited 2 times in total.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3447)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
User avatar
Hacker
Moderator
Moderator
Posts: 13061
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: How to make the number of levels in Find Files persistent

Post by *Hacker »

mmm,
However I find your scripting skills absolutely astonishing, I am not leaning towards this approach. Thinking about a clean solution in GUI available for all TC users - if they are interested.
While I understand this approach, keep in mind that the workaround I (and e.g. Horst.Epp) offer is available now. An implementation, if at all, won't come for some time.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: How to make the number of levels in Find Files persistent

Post by *Usher »

2mmm
What about using Alt+Shift+F7 and Find files in a separate process? You can keep that window open throughout a TC session and feed search results to main TC window if needed.
Andrzej P. Wozniak
Polish subforum moderator
mmm
Member
Member
Posts: 120
Joined: 2020-08-10, 12:32 UTC

Re: How to make the number of levels in Find Files persistent

Post by *mmm »

A crash of thunder in dead calm. Nice!

How do you synchronize the search path in the Find files dialog when switching between the panes in the Main window or walking up and down the tree in the Main window?
Also, could please drop a line or two about "feeding search results to the main window" ?

I swear I would not ask if I could find a decent TC manual. Is there any?
Post Reply