Jump to content

Read


Recommended Posts

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

  • Moderators

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

@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.

System_ninja.jpg

That part(how many files it found) i want to write to a log file.

Edited by Barukkumun
Link to comment
Share on other sites

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 :lol: )

Edit: removed the info to shorten this post cause it didnt work, the ID kept on changing
Edited by Barukkumun
Link to comment
Share on other sites

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

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 ~ getENVvars
My 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

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.

>>>> 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

  • 2 weeks later...

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 :D 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...