nooneclose Posted October 15, 2019 Posted October 15, 2019 (edited) I have searched for almost an hour and I still cannot find examples and or the code that I am looking for concerning my question. I am wanting to capture/read/send (however you want to say it) the console output to a file. Here is a picture of what I want to send to a file after the script runs. (what is in the console output/window after the script runs) Edited October 16, 2019 by nooneclose Problem solved
spudw2k Posted October 16, 2019 Posted October 16, 2019 I'm not sure there is a way to do this within the executing script as it is something being handled by the SciTE editor and not the autoit interpreter. You would need an external script or other means to capture and save the output. Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF
jchd Posted October 16, 2019 Posted October 16, 2019 If you run a compiled script, you can redirect ConsoleWrite() output to a file: C:\...\MyProg >file.txt You can perhaps redirect Scite console similarly by redirecting stdout when launching SciTE (not tried). Ext4 1 This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)
nooneclose Posted October 16, 2019 Author Posted October 16, 2019 (edited) I edit my script too often (several times per hour, 40 hours a week) to keep re-compiling it. (until it is done) if there isn't a way that's fine I guess. I will just keep copying and pasting it manually. I cannot run two different scripts (I think) because my main code, which is not in the picture and over 7k lines, is a bot. I do not want another script running while the bot is running. Thank you for your advise and time If anyone else has an idea please share. Edited October 16, 2019 by nooneclose grammar
orbs Posted October 16, 2019 Posted October 16, 2019 @nooneclose, from the image you attached, i cannot understand what is it that you want to capture. if it is some console output from your script that is made by calling ConsoleWrite(), then you can quite easily replace your ConsoleWrite() calls with a custom function to send the output to a file. if it is some stats about the operation of the script, then you'd better describe it more clearly if you are to expect some further help. Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates WinPose - simultaneous fluent move and resize Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff Magic Math - a math puzzle Demos: Title Bar Menu - click the window title to pop-up a menu
nooneclose Posted October 16, 2019 Author Posted October 16, 2019 @orbs I was trying to use the green box as a highlighter in the picture to show what I wanted to capture. I have many "consoleWrite" throughout my actual script. Is there a way for a single function to tell all of them to write to a file or will I have to edit each one?
orbs Posted October 16, 2019 Posted October 16, 2019 add a function called something like _ConsoleFileWrite() which accepts a single string parameter, exactly like ConsoleWrite(). inside this function you will pass the string parameter to a standard FileWrite() command with a predetermined file name. once that is set up, use SciTE menu Search -> Replace... to replace all your ConsoelWrite to _ConsoleFileWrite, and you're set to go. Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates WinPose - simultaneous fluent move and resize Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff Magic Math - a math puzzle Demos: Title Bar Menu - click the window title to pop-up a menu
nooneclose Posted October 16, 2019 Author Posted October 16, 2019 @orbs I figured it out on my own. Thanks for trying to help though. Here is what I used to get the console output to a file. Local Const $sFilePath = _WinAPI_GetTempFileName("C:\Users\?\Desktop\General\AutoIt_Stuff\AU3 include files\LOG\") Local $hFileOpen = FileOpen($sFilePath, 1) Local $hWnd = WinWait("[CLASS:SciTEWindow]", "", 10) Local $sText = ControlGetText($hWnd, "", "Scintilla2") _FileWriteLog($sFilePath, $sText) FileClose($hFileOpen)
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