dabus Posted November 1, 2005 Share Posted November 1, 2005 I use a simple wrapper for blat to use as a console-mail-tool. The only thing that I would love to do is write the help to cmd's stdout. (I open cmd; do a sendmail --help; the output should just be typed into this cmd-window -- or can you explain to me how to do a type without opening a second cmd-instance? ). I know that it's possible to do this via mouse, but I would like to know if this can be done alternatively. StdinWrite seems to modify an already existing "stream", that's not exactly what I want to do (or can autoit modify its own output? Link to comment Share on other sites More sharing options...
MSLx Fanboy Posted November 1, 2005 Share Posted November 1, 2005 ConsoleWrite is the output stream for AutoIt, however, it will not send it to cmd (as it is a gui application). I believe someone is working on modifying an compiled exe of a script so as to run and output to cmd, however, I'm not sure about that.You could pipe the output back to the command line. But because I can't think of that this minute, you could pipe it to a file (dir > tempfile.txt), and then type it back to the screen (type tempfile.txt).At the End of the script, just do Run(@COMSPEC & " /k type tempfile.txt"), and that should work Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate()) Link to comment Share on other sites More sharing options...
Valik Posted November 1, 2005 Share Posted November 1, 2005 I believe someone is working on modifying an compiled exe of a script so as to run and output to cmd, however, I'm not sure about that.If you aren't sure of something, it is usually best to say nothing. The idea of modifying a compiled script to make it a CUI application has already been done and is dangerous. Not only that, to circumvent people doing dangerous things, I wrote a small wrapper to serve as a proxy between the CLI and a GUI application so that the streams are "connected". Link to comment Share on other sites More sharing options...
MSLx Fanboy Posted November 1, 2005 Share Posted November 1, 2005 I've found that if you aren't SURE about something, but do believe that you are correct, it is best to state it, even if you are not 100% sure, as:It gives them something to look in toIf someone proves you otherwise, then you know in the future that the 'something' does not exist, and does not need to be brought up in the future Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate()) Link to comment Share on other sites More sharing options...
markusss Posted November 2, 2005 Share Posted November 2, 2005 I think this is what you want, if not than I'm sorry Valik, you're not really motivating people to help others out Felix Link to comment Share on other sites More sharing options...
Valik Posted November 2, 2005 Share Posted November 2, 2005 I think this is what you want, if not than I'm sorry Valik, you're not really motivating people to help others out FelixMisinformation annoys me. Whats worse than giving somebody free information is giving them free wrong information. Link to comment Share on other sites More sharing options...
markusss Posted November 2, 2005 Share Posted November 2, 2005 Is that related to my post or only to "Valik, you're not really motivating people to help others out"? Link to comment Share on other sites More sharing options...
Valik Posted November 2, 2005 Share Posted November 2, 2005 Is that related to my post or only to "Valik, you're not really motivating people to help others out"?Just the comment, you linked to the correct thread. Link to comment Share on other sites More sharing options...
dabus Posted November 2, 2005 Author Share Posted November 2, 2005 Thanks for your advice, but could someone please tell me how to invoke it? If I do a Run ( "stub.exe bla.exe" ) the stub will still create another terminal and run in that window. I would like to run the stub in the terminal the compiled script is running in. I'm pretty sure, this can be done, but I just don't get it... Link to comment Share on other sites More sharing options...
Valik Posted November 2, 2005 Share Posted November 2, 2005 the stub will still create another terminal and run in that window. I would like to run the stub in the terminal the compiled script is running in.I'm pretty sure, this can be done, but I just don't get it... Sigh. The entire point of stub.exe is because you can't do that so you start stub.exe from a Console window passing it the path of the script to start and then stub.exe bridges the gap between the Console window and the AutoIt script. Link to comment Share on other sites More sharing options...
dabus Posted November 3, 2005 Author Share Posted November 3, 2005 Thx again, I would have searched for ages since autoit often surprised me with a bunch of solutions. So I'll use this workaround to get my Help printed: Func Help() BlockInput ( 1 ) $Mouse=MouseGetPos ( ) ClipPut ( "type %Temp%\SendMail-Help.txt" ) $HelpFile=FileOpen ( @TempDir &"\SendMail-Help.txt" , 2 ) FileWriteLine ( $HelpFile, '...' ) FileClose ( $HelpFile ) $Title=WinGetTitle ("" ) $Pos=WinGetPos ( $Title ) MouseClick ( "right", $Pos[0]+($Pos[2]/2), $Pos[1]+($Pos[3]/2), 1, 0 ) MouseClick ( "left", $Pos[0]+($Pos[2]/2)+20, $Pos[1]+($Pos[3]/2)+45 , 1, 0) Send ( "{Enter}" ) MouseMove ( $Mouse[0], $Mouse[1] , 0) BlockInput (0) Exit EndFunc ;==>Help Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now