The beauty of the Windows (or Unix) batch language is that it is almost infinitely extensible via external utilities that take input from their command line or from the standard input device and send results to the standard output device. It is not merely its ability to conveniently
launch such executables that is the strength of the batch language, it is also its ability to efficiently
capture their ouput for further processing (e.g. the FOR /F command, piping, etc.)
So what about AutoHotkey? Even if some other extension mechanism for AutoHotkey were to become available (invoking DLLs, making API or ActiveX calls, etc.), it seems likely that external console utilities will always be a big part of our scripting arsenal, and I for one would love to see their use in AutoHotkey become more convenient and more efficient. Currently, the typical scenario (in which the contents of one variable needs to be passed as standard input to an external utility and another variable needs to eventually contain the utility's standard output) requires the use of disk files and of the command processor, something along the lines of
FileAppend, %InVar%, InFile.tmp
RunWait, %ComSpec% /C Utility.exe < InFile.tmp > OutFile.tmp,, Hide
FileRead, OutVar, OutFile.tmp
I know, this is the most general case -- in the special case where the input consists of a single text line, an input file may be avoided and we can get away with
RunWait, %ComSpec% /C Echo %InVar%| Utility.exe > OutFile.tmp,, Hide
FileRead, OutVar, OutFile.tmp
Either way, we still need to use disk files and the command processor (and I'm not even mentioning the extra lines required to manage and clean up the temporary files used). Even such a valient alternative as
corrupt's
CmdRet utility (decribed elsewhere in these forums) requires extra machinery (creating a GUI with an Edit control, etc).
So, what I'm suggesting (if it hasn't been suggested before) is an extension of RunWait to allow the direct specification of input and/or output variables corresponding to the target executable's STDIN and STDOUT. The actual mechanism used to implement this need not be anything too fancy, maybe just copying the variables' contents to and from in-memory temporary files and providing those filespecs as the external program's STDIN and STDOUT. The point is to integrate external "helper" utilities into AutoHotkey in as natural a fashion as possible. [If you feel ambitious, providing a redirection capability for STDERR, like CMD's
2> feature, wouldn't be a bad thing either!

]
Anyway, that's my pitch.
Thanks,
Jacques.