Replacing TC's Search

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
romulous
Senior Member
Senior Member
Posts: 226
Joined: 2003-11-19, 04:10 UTC

Replacing TC's Search

Post by *romulous »

TC enables you to replace the built-in file comparison function with external tools (via CompareTool=) - is there a similar function for search?

I find the TC search function (Alt+F7) does not quite meet my needs, and I want to replace it with an external tool that does (Agent Ransack). The idea is that I want Agent Ransack to launch when I hit Alt+F7 (instead of TC's internal search), and I want TC to pass to Agent Ransack the folder path that I am currently in (what TC's search calls "Search In").

Is this possible at all?

Thanks.
tpr
Junior Member
Junior Member
Posts: 37
Joined: 2011-06-05, 12:55 UTC

Post by *tpr »

Go to Options -> Misc, select the hotkey you need (Alt+F7). The Command field says "Default command (no remapping)", click on the magnifying glass icon and click on usercmd.ini. Click on New..., add a name, and then in the "Change user command" type the path of the program, add 'd "%P"' (without the single quotes) to the Parameters, and fill in the other fields implicitly. Click OK twice, and click on the green tick icon.
Last edited by tpr on 2011-10-16, 08:01 UTC, edited 1 time in total.
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

That wont work for "replacing" TC's search. The search tool in question would need to provide an option to pass the results back to TC. Not all search tools will have that option, they tend to default everything to Explorer.
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
tpr
Junior Member
Junior Member
Posts: 37
Joined: 2011-06-05, 12:55 UTC

Post by *tpr »

You're right, this solution fails in that context but in the request romulous didn't wrote he need that (though presumably he does :))
User avatar
romulous
Senior Member
Senior Member
Posts: 226
Joined: 2003-11-19, 04:10 UTC

Post by *romulous »

...Because I hadn't thought of it :)

Now that you have mentioned it, that would be an extra handy feature. I wonder if there is a way to get the data from Ransack back to TC?
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

A number of search tools I employ have a copy selection to clip (full paths, or just file names). What TC is missing, and has been requested multiple times, is the ability to generate a Virtual File list (like TC already does when you feed a search result to ListBox).

If TC would allow on-the-fly virtual listboxes, one could create them from clipboard or text files (generated from CMD batch) or numerous other ways. It would be extremely useful.
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
User avatar
romulous
Senior Member
Senior Member
Posts: 226
Joined: 2003-11-19, 04:10 UTC

Post by *romulous »

Yes, I can see how that would be useful. Because it never hurts to ask, I've asked the Ransack author if he can add something to push the results into TC.
User avatar
fabiochelly
Power Member
Power Member
Posts: 603
Joined: 2003-02-05, 12:03 UTC
Location: Rambouillet, France

Post by *fabiochelly »

This doesn't work beacause Ransack doesn't handle directories containing a trailing backslash.

Currently, I have to use %p instead of %P.

Is there a way to send a directory without a trailing backslash?
Fabio Chelly.
#60241
Lorsqu'on s'occupe d'informatique il faut faire comme les canards...
Paraître calme en surface et pédaler comme un forcené par en dessous
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

Maybe Mr.Ghisler can "fix" that, the current implementation is inconsistent.

If your cursor is on [..], %P%S sends "C:\Example\Folder\"
If your cursor is on a folder itself, then
%P%S sends "C:\Example\Folder\Here"
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
User avatar
fabiochelly
Power Member
Power Member
Posts: 603
Joined: 2003-02-05, 12:03 UTC
Location: Rambouillet, France

Post by *fabiochelly »

I found a way to do it:

In fact, Ransack treats the trailing backslash as an escape for the quotes.
So I just had to add an extra bacsklash to make it work:
Parameters: -d "%P\"

And it works fine!

By the way I'm using Ransack only beause of the contents viewer which allows me to see where occurences has been found inside each file. It would be great to integrate a content viewer into Total Commander (like with FreeCommander).
Fabio Chelly.
#60241
Lorsqu'on s'occupe d'informatique il faut faire comme les canards...
Paraître calme en surface et pédaler comme un forcené par en dessous
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50937
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Most of the time it helps to append a dot:
"%P."
Author of Total Commander
https://www.ghisler.com
User avatar
fabiochelly
Power Member
Power Member
Posts: 603
Joined: 2003-02-05, 12:03 UTC
Location: Rambouillet, France

Post by *fabiochelly »

Thank you, appending a dot works too.

For my suggestion, is it possible to add to your wishlist the ability to see the content of files (with the searched text in bold) in TC results window?
Fabio Chelly.
#60241
Lorsqu'on s'occupe d'informatique il faut faire comme les canards...
Paraître calme en surface et pédaler comme un forcené par en dessous
User avatar
MVV
Power Member
Power Member
Posts: 8713
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Recently I've known that root folders doesn't contain "." item so appending a dot may not work in roots.
Post Reply