Page 1 of 1

Use text from "Find File" dialog in external viewe

Posted: 2012-03-07, 07:03 UTC
by grim
Pre:
- Options: Set "Viewer for F3" to "External viewer" (e.g. Universal Viewer)

1. Open "Find Files" dialog
2. Search for text inside the files, i.e. check "Find Text" and enter some text to appropriate textbox (e.g. "TextToSearch").
3. start search
4. once the search finishes, push "Feed to listbox" button
5. push F3 to open one of the files found and push F3 again to start "Find next" in opened file.
6. external viewer (Universal Viewer) does NOT search for "TextToSearch" (but internal Lister would).

It is obvious every external viewer uses different cmd-line parameter to specify search string (or it doesn't support it at all), but I guess the parameter could be manually specified in config-file of TC. e.g.:
Viewer=<path>\universal_viewer\Viewer.exe
ViewerExternalSearchCommand=/FText=%s

Posted: 2012-03-07, 20:22 UTC
by sqa_wizard
Well, you cannot force an external to use your "TextToSearch".
The external viewer has to catch the text by its own.

You may use SynWrite as viewer, which already works that way.

Posted: 2012-03-07, 20:48 UTC
by grim
why not?

I guess that selected file is passed to external viewer as one (the only?) parameter using one of winapi functions, e.g. ShellExecute, so you can add one more argument that specifies search command,e.g (pseudocode):

string executable = $VIEWER
string parameters = $SELECTED_FILE + " " + $VIEWER_EXTERNAL_SEARCH_COMMAND + "=" + $TEXT_TO_SEARCH

ShellExecute(xxx, executable, parameters, ...)

am i totally wrong?

Posted: 2012-03-11, 16:26 UTC
by Alextp
I support, supp. of this parameter needed.