Danith Posted June 29, 2009 Share Posted June 29, 2009 (edited) I have instructions for my script print out using the ConsoleWrite command. When you run it, nothing shows up on screen. If you do a "<scripname> >> output.txt" the instructions will show up. How do I just have it output and display to the screen? Or do I have to do something where it writes the info to a text file then displays it by calling "more <textfile>" ? Edited June 29, 2009 by Danith Link to comment Share on other sites More sharing options...
Mat Posted June 29, 2009 Share Posted June 29, 2009 Have you tried compiling it as a console app? The option is there in Aut2Exe.Alternatively if you use scite, you can see it there.[advertisement]Or use this [/advertisement]MDiesel AutoIt Project Listing Link to comment Share on other sites More sharing options...
Danith Posted June 29, 2009 Author Share Posted June 29, 2009 (edited) Have you tried compiling it as a console app? The option is there in Aut2Exe. Alternatively if you use scite, you can see it there. [advertisement]Or use this [/advertisement] MDiesel Yes, compiled it has the same behavior as uncompiled. Text only shows if I redirect stdout to a file (thats what >> does, right?) Oh, and to clarify. The output does show up in the output box in scite. It doesn't show up if I execute the script from the command line (c:\program files\autoit\autoit3.exe myscript.au3) or if I compile it into an exe and then run it from the command line. I guess for what I'll be using it for it doesn't really matter that much but I'm curious Edited June 29, 2009 by Danith Link to comment Share on other sites More sharing options...
Lars Posted June 29, 2009 Share Posted June 29, 2009 Did you run it from the command line or just double clicked it in explorer? If so add a pause or sleep at the end of your script so the dosbox won't flash away before youy can see it. Link to comment Share on other sites More sharing options...
Danith Posted June 29, 2009 Author Share Posted June 29, 2009 Did you run it from the command line or just double clicked it in explorer? If so add a pause or sleep at the end of your script so the dosbox won't flash away before youy can see it. Yes . C:\>report_run.exe C:\> This demonstrates it If $CmdLine[0] = 0 Then ConsoleWrite("Error: Enter reports you want to run") _Help() Exit 1 EndIf Func _Help() ConsoleWrite( @CRLF & "Usage: " & @ScriptFullPath & " ""report name 1"" ""report name 2"" .. etc " & @CRLF & _ "This will hopefully" & @CRLF & _ "output to the console/command line" & @CRLF & _ "but it doesn't seem to work" & @CRLF & _ "you can see the text by directing it" & @CRLF & _ "to a file." & @CRLF & _ "i.e. """ & @ScriptFullPath & " >> text.txt""" & @CRLF & _ "blah blah" & @CRLF & _ "more stuff" & @CRLF ) EndFunc Link to comment Share on other sites More sharing options...
Skruge Posted June 29, 2009 Share Posted June 29, 2009 Did you compile it as a Console App as MDiesel suggested? Add this to your script and recompile it:#AutoIt3Wrapper_Change2CUI=y [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
Danith Posted June 29, 2009 Author Share Posted June 29, 2009 Did you compile it as a Console App as MDiesel suggested? Add this to your script and recompile it:#AutoIt3Wrapper_Change2CUI=y Ahh thanks.. put me on the right track Adding that option to my script didn't do anything, but manually compiling made it work with the following options: /comp 4 /pack /console 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