As it so happens, I’d tried to do exactly the same thing before I read your post, with equal lack of success.
I can at least tell you how to get rid of the error message. When you go into the Workbench Tools->External Tools dialog, you need to copy the directory where you have the batch file into the Initial Directory box (in my case I have C:\Users\Eric\Documents\TADS 3\tadsDocSearch\search.bat in the Program Box and C:\Users\Eric\Documents\TADS 3\tadsDocSearch in the Initial Directory box). I then don’t get the error message - but I don’t see your search program come up either.
One guess I have is that programs run as Workbench external tools aren’t meant to run interactively, but rather to have a parameter passed to them (see the Arguments section of the external tools dialogue). I ran a quick test by writing the following TADS 3 program (bare T3 with no libraries):
* The main entrypoint - the T3 virtual machine calls this function to
* start the program running. 'args' is a list of strings giving the
* command-line arguments that the user specified, if any.
// put your program code here
And then compiling it as an .exe (to do that you need to delete the .txt file from the list under Resource Files, otherwise Workbench complains that it can’t open it). You can then add the resulting exe file as an external tool, set the starting directory to the location of the exe file, and select $(SelText) as the argument. If you then select some text in Workbench and click on the tool, you indeed get a TADS interpreter window open echoing the text you selected.
This suggests to me that you may be able to get your search tool to work if you can get it to accept an argument which is the word it then searches for, without stopping to ask for user input if an argument is supplied. It may then be possible to use the search tool from within Workbench by selecting the text for which you want to search, and then launching the tool. That said, I’m not at all confident that this is the answer.
If this doesn’t work, my quick experiment suggests that it would almost certainly be possible to write the search tool in TADS 3 (plain TADS3 without any game libraries). This is what I did for the docindex tool that indexes the library manual (you can find the source, not all that well commented, in my GutHub repo). To get round TADS 3 file permissions issue the TADS program would probably need to reside in the adv3Lite directory, but that would have the advantage that the relative paths to all the adv3Lite docs would be known (i.e., could be hard-coded) without the user having to set them up. If the TADS 3 program was supplied both as a t3 and an exe then on non-Windows systems the t3 version could still be used as a search tool.
That said, further experimentation suggests that while running a TADS 3 exe from Workbench in this way sometimes works, it tends to crash Workbench, so this may not be a full answer either!