Hello all,
Is there a way to customize command cm_SearchFor 501 with already prefilled paths in "Search in" field and prefilled file types in "Search for" field ?
I want to find for a text in files "*.c *.h *.asm" but in multiple directories like "d:\dir1\dir1_1 d:\dir2 d:\dir3_3_3".
I was thinking to customize cm_SearchFor and to specify file types and path directories as input.
Many thanks
Shortcut for searching in specific paths for a text in specific file types
Moderators: Hacker, petermad, Stefan2, white
- ghisler(Author)
- Site Admin
- Posts: 50883
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Shortcut for searching in specific paths for a text in specific file types
You can save search parameters via 4th tab of the search dialog, then use a button with:
LOADSEARCH name of saved search
LOADSEARCH name of saved search
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Shortcut for searching in specific paths for a text in specific file types
In your case, using loadsearch is flexible enough if:
- You fill search in parameter (if you read help do not mess up with > char as it is not mandatory at least in B12) !
- You can use also use temp file to search in folder list like @c:\temp\MyFolderList.txt and prepare project or workpace file .... even use with virtual panel or any script to prepare your temporary list.
- You fill search in parameter (if you read help do not mess up with > char as it is not mandatory at least in B12) !
- You can use also use temp file to search in folder list like @c:\temp\MyFolderList.txt and prepare project or workpace file .... even use with virtual panel or any script to prepare your temporary list.
Re: Shortcut for searching in specific paths for a text in specific file types
support++
I'm writing almost the same feature request thread.
allow saving a search setting leaving one or some parameters input when they were called.
it is a bit like the starting ? in command bottom.
for example, I have a search plugin call AGE, which is calculate the last modified time or the created time by now. with it, I can easily search files like the created time or last modified time is in last 10 days. which is really useful when come to a backup files.
but at the moment, the load search is fixed, which mean the 10 days in the above example is fixed too. it is much more flexible if allow param like
loadsearch foosearch 10
I'm writing almost the same feature request thread.
allow saving a search setting leaving one or some parameters input when they were called.
it is a bit like the starting ? in command bottom.
for example, I have a search plugin call AGE, which is calculate the last modified time or the created time by now. with it, I can easily search files like the created time or last modified time is in last 10 days. which is really useful when come to a backup files.
but at the moment, the load search is fixed, which mean the 10 days in the above example is fixed too. it is much more flexible if allow param like
loadsearch foosearch 10
Re: Shortcut for searching in specific paths for a text in specific file types
Hi Dindog,dindog wrote: 2020-01-11, 01:50 UTC support++
I'm writing almost the same feature request thread.
allow saving a search setting leaving one or some parameters input when they were called.
it is a bit like the starting ? in command bottom.
for example, I have a search plugin call AGE, which is calculate the last modified time or the created time by now. with it, I can easily search files like the created time or last modified time is in last 10 days. which is really useful when come to a backup files.
but at the moment, the load search is fixed, which mean the 10 days in the above example is fixed too. it is much more flexible if allow param like
loadsearch foosearch 10
This is not suggestion thread !
TC does not embed any scripting language and is sometime not as parametric as we need but
Today the way to achieve your need is to create an external script/pgm to do it !
This script will :
read %commander_ini%
remove any temporary search from the searches section
take a "foosearch/any parameter" search as template and duplicate it to a temporary search replacing parameters from the command line using a naming convention (%x or $x or whatever) ...
save %commander_ini%
You can use AskPraram to fill your script or %A in a em_command if you want to fill it from command bar !
You will also have to call TC to launch loadsearch with the temporary search. This can be done using a dedicated em_command and call externally or internally...
Re: Shortcut for searching in specific paths for a text in specific file types
This option with LoadSearch is good but not perfect
Is there a method to press a key or execute a button that load the saved search automatically ?

Re: Shortcut for searching in specific paths for a text in specific file types
A button for starting the saved search Mysearch:
Code: Select all
TOTALCMD#BAR#DATA
LOADSEARCH Mysearch
wcmicons.dll,47
Start Search with Mysearch
-1
To make the button:
1. Mark the green text above (click SELECT ALL).
2. Copy it to the ClipBoard (press Ctri+C).
3. Right click on TC's buttonbar and choose "Paste".
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar