Barukkumun Posted April 21, 2015 Share Posted April 21, 2015 Hi, First of All, I am new with autoit and trying to get some functions down. I am making an automatic clean process, its running clean programs and control the clicks with controlclick. Now after i have run System ninja i want to read the result and write it in to a log, but cant find a function to read someting in an external program. Can some one give me a push in the right direction? $TITLE = "System Ninja" $SUB = "100%" WinWait($TITLE, $SUB) If Not WinActive($TITLE, $SUB) Then WinActivate($TITLE, $SUB) WinActive($TITLE, $SUB) ControlClick($TITLE, $SUB, "Delete Everything","",1, 210, 12) Sleep (5000) $TITLE = "Scan For Junk" $SUB = "Files Found" WinWait($TITLE, $SUB) If Not WinActive($TITLE, $SUB) Then WinActivate($TITLE, $SUB) WinActive($TITLE, $SUB) $x = Filereadline($SUB, 1) FileWriteLine($log, $x) Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted April 21, 2015 Moderators Share Posted April 21, 2015 ? _FileWriteLog in the help file? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Barukkumun Posted April 21, 2015 Author Share Posted April 21, 2015 @JLogan3o13, Thanks. But what you gave me is for writing log files. What i need is to read data from the external screen that is on the active window. Like the result from a virus scan, how many files it deleted. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted April 21, 2015 Moderators Share Posted April 21, 2015 Barukkumun, for future reference, this is where you providing as much information as possible will allow you to get help much more quickly: You stated "read the result and write it to a log file", which is what I gave you. If you are wanting to read from a specific window, such as a virus scan product, you need to say so. You also need to specify which application you're trying to read the results from (reading the results from MS Security Essentials is going to be different than reading from McAffee, etc.). Help us help you by including as much information as possible (including screenshots if needed) when asking your questions "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Barukkumun Posted April 21, 2015 Author Share Posted April 21, 2015 (edited) @JLogan3o13, you are right, i thought I explained enough after the System ninja part. I am running A System ninja scan at the moment and after you have scanned and deleted the "infected" files the screen gives you how many files it found, i have highlighted it in the image below. That part(how many files it found) i want to write to a log file. Edited April 21, 2015 by Barukkumun Link to comment Share on other sites More sharing options...
Tripredacus Posted April 21, 2015 Share Posted April 21, 2015 This is an idea (I have not done it before) but can you use Au3info to get the ID of that part (if it has one) and then be able to read it with your script? Twitter | MSFN | VGCollect Link to comment Share on other sites More sharing options...
Barukkumun Posted April 21, 2015 Author Share Posted April 21, 2015 (edited) This is an idea (I have not done it before) but can you use Au3info to get the ID of that part (if it has one) and then be able to read it with your script? I have tried but too bad it didnt gave an id(the part i want)(Thanks for the Idea anyways ) Edit: removed the info to shorten this post cause it didnt work, the ID kept on changing Edited April 21, 2015 by Barukkumun Link to comment Share on other sites More sharing options...
Wingens Posted April 22, 2015 Share Posted April 22, 2015 I tried to help, by looking for you but i can't wrap my head arround the sollution. Is there a way to copy visible text from the screen? When i used Autoit Window Info it showed my the text you want in the tab: Visible text. But i can't seem to figure out how to copy it. Anyone? Link to comment Share on other sites More sharing options...
MikahS Posted April 22, 2015 Share Posted April 22, 2015 Have you tried the Class or ClassNN instead of title or ID? If you can see the visible text being the element that you want in the win info tool, then you can also use that to try and grab that Ctrl. Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ Link to comment Share on other sites More sharing options...
Wingens Posted April 23, 2015 Share Posted April 23, 2015 When i use this: #include <MsgBoxConstants.au3> #include <Array.au3> #RequireAdmin $TITLE = "System Ninja" $SUB = "Files Found" Local $text = WinGetClassList($TITLE, "") Local $array = StringSplit($text, @LF, 1) For $i = 1 To $array[0] $text = ControlGetText($TITLE, "", "[CLASS:" & $array[$i] & "; INSTANCE:" & $i & "]") If Not $text = "" Then MsgBox(0, "Instance: " & $i, $text) Next It does not show, below you will find the summary of the Window Info Tool. expandcollapse popup>>>> Window <<<< Title: System Ninja 3.0.6 Class: WindowsForms10.Window.8.app.0.378734a Position: 1930, 515 Size: 695, 388 Style: 0x16CF0000 ExStyle: 0x00050100 Handle: 0x000E0DD8 >>>> Control <<<< Class: WindowsForms10.Window.8.app.0.378734a Instance: 3 ClassnameNN: WindowsForms10.Window.8.app.0.378734a3 Name: Advanced (Class): [CLASS:WindowsForms10.Window.8.app.0.378734a; INSTANCE:3] ID: 1117640 Text: Position: 0, 40 Size: 679, 297 ControlClick Coords: 546, 284 Style: 0x56800000 ExStyle: 0x00010000 Handle: 0x00110DC8 >>>> Mouse <<<< Position: 2484, 870 Cursor ID: 0 Color: 0xFFFFFF >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< System Ninja Cancel Delete Files Scan Results 50 Files Found (3,53MiB) Miscellaneous Junk Recent Files Memory Dumps Windows Logs Internet Cache Internet History Internet Cookies Folder Config Files Game Caches Thumbnail Caches Incompatible Files Common Torrent Tags Temporary Files 20% (Files Scanned: 66117) >>>> Hidden Text <<<< Empty Folders The line i need is: 50 Files Found (3,53MiB) Link to comment Share on other sites More sharing options...
Barukkumun Posted May 6, 2015 Author Share Posted May 6, 2015 Give this tread a rest, i havent found a solution and made the choice to not include logging in this program.i can't make it fully automatic anyways since i dont get any info with the window info tool from auto it from Mbar en Mbam so i completly changed my script to a another concept. anyways everyone who tried to help: Thanks u are great 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