Saved search: how to put a current path there (like %P) instead of a literal one?

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
beb
Power Member
Power Member
Posts: 579
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Saved search: how to put a current path there (like %P) instead of a literal one?

Post by *beb »

Let's say, I'd wish to have a universal command to find duplicates.
Let's say, I set up a search and saved it for future needs.
Alas, the saved entry would feature a literal path used upon saving.
Instead, I'd like to have a path from an active pane as the root for the search.
How to do that?

Here's what it looks like in the .ini (implies the fixed path):

Code: Select all

duplicates_SearchFor=
duplicates_SearchIn=l:iteral\path\upon\saving\the\search
duplicates_SearchText=
duplicates_SearchFlags=0|007002010021|||||||||1110|||
Here's what I would like to have (implies a variable that reflects a current path):

Code: Select all

duplicates_SearchFor=
duplicates_SearchIn=%P
duplicates_SearchText=
duplicates_SearchFlags=0|007002010021|||||||||1110|||
Where %P is a known TotalCommander's 'special parameter' for 'the source path to be inserted into the command line...'
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10/15
User avatar
beb
Power Member
Power Member
Posts: 579
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: Saved search: how to put a current path there (like %P) instead of a literal one?

Post by *beb »

Oh, sorry.
As soon as I posted it here, out of curiosity, I just tried to put the "duplicates_SearchIn=" empty and it just worked as intended.

Code: Select all

duplicates_SearchFor=
duplicates_SearchIn=
duplicates_SearchText=
duplicates_SearchFlags=0|007002010021|||||||||1110|||
PS Now I'm unsure if this is useful info, or should the thread be deleted?
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10/15
User avatar
Dalai
Power Member
Power Member
Posts: 9945
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Saved search: how to put a current path there (like %P) instead of a literal one?

Post by *Dalai »

If you leave the field "Search in" empty, TC will use the current path for the search. Or put a > character in it before saving the search:
TC help, Find Files: General wrote:Search in:
Put '>' character in this field before saving the search to keep the "Search in" field unchanged when loading the saved search.
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
beb
Power Member
Power Member
Posts: 579
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: Saved search: how to put a current path there (like %P) instead of a literal one?

Post by *beb »

2Dalai
Thank you, now I see it in the help.
The TotalCommader help (chm) index includes five entries regarding search: Search; Search function; Searching; Searching files; Searching for file contents.
Somehow before asking here I didn't make it to the description you're citing :(
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10/15
Post Reply