Search the Community
Showing results for tags 'standard'.
-
Hey guys, I have never touched the standard output functions (Other than ConsoleWrite for debugging). At the moment, I am trying to develop a console application (as shown below) which should attach to AutoIT script processes, and show everything read from the standard output of the file. I am aware that Scite has a console (as are most people) but I want to be able to read the standard output of other programs, and feel that this would be a good way to start learning to do so. Here is the code I have done so far: FileWrite(@ScriptDir&"TestScript.au3", "For $Repeat = 0 to 100"&@CRLF&@TAB&'ConsoleWrite("Text_"&$Repeat&@CRLF)'&@CRLF&@TAB&"Sleep(1000)"&@CRLF&"Next") $GUI = GUICreate("Console", @DesktopWidth / 3, @DesktopHeight / 2) $EDT = GUICtrlCreateEdit("", 0, 0, @DesktopWidth / 3, (@DesktopHeight / 2)-25) $BTN = GUICtrlCreateButton("Update", 0, (@DesktopHeight/2)-25, @DesktopWidth/3, 25) GUISetState() $ProcessName = Run(FileGetShortName(@AutoItExe)&" "&@ScriptDir&"TestScript.au3") While 1 $MSG = GuiGetMsg() Switch $MSG Case -3 FileDelete(@ScriptDir&"TestScript.au3") Exit Case $BTN GUICtrlSetData($EDT, StdoutRead($ProcessName)) EndSwitch WEnd Have I done something wrong here? I have been kicking myself over this all day and have gone as far as I can with the help file, and don't know what I am doing wrong. Can somebody give me some pointers please? Thanks. Hahaha this forum works wonders. I figured it out hahaha! I had to run it like this: $ProcessName = Run(FileGetShortName(@AutoItExe)&" "&@ScriptDir&"TestScript.au3", @ScriptDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) I tried doing this earlier, but with another script and it didn't work. Well, atleast I have it figured out now. I think earlier, I didn't specify a working directory or something, maybe.