Sign in to follow this  
Followers 0
smti

Looking for text

11 posts in this topic

Hi Everyone:

I am attempting to automate the installation of an AV application. In doing so, I am trying to determine whether or not text is visible on the screen. This is what I have tried:

Do
    If WinGetText("[CLASS:Static; INSTANCE:27]", "Congratulations! YOU ROCK!")
        $InstallComplete = 1
        MsgBox(4096, "Message!", "Control is active!", 10)
        Sleep(30000)
    Else
        $InstallComplete = 0
        MsgBox(4096, "Message!", "Control is NOT active!", 10)
        Sleep(30000)
    EndIf
Until $InstallComplete = 1

Even when the control is not visible -- namely the text is not being displayed, a message box still pops-up and indicates that the control is active. Any help on how to fix this, or other possible solutions would be greatly and most appreciated!

Thank you!

Share this post


Link to post
Share on other sites



Hi,

You are using the wrong function, it should be ControlGetText() = "whatever".

Take a look at the helpfile.

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

can use SplashTextOn

Do
    If WinGetText("[CLASS:Static; INSTANCE:27]", "Congratulations! YOU ROCK!") Then
        $InstallComplete = 1
        SplashTextOn("OK", "Control is active!", 270, 50, -1, -1, 1, "", 18)
        ;MsgBox(4096, "Message!", "Control is active!", 10)
        Sleep(30000)
    Else
        $InstallComplete = 0
        SplashTextOn("OK", "Control is NOT active!", 270, 50, -1, -1, 1, "", 18)
        ;MsgBox(4096, "Message!", "Control is NOT active!", 10)
        Sleep(30000)
    EndIf
Until $InstallComplete = 1

Share this post


Link to post
Share on other sites

This code is perfectly normal to your eyes :

WinGetText("[CLASS:Static; INSTANCE:27]", "Congratulations! YOU ROCK!")

It should tilt in your head.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

I also tried this: 

Do
    $FinalScreen = ControlCommand("VIPRE Antivirus 2012", "Congratulations! YOU ROCK!","1077","IsVisible")
    If ($FinalScreen) = 1 Then
    MsgBox(4096, "Message!", "On Final screen!", 10)
    $InstallComplete = 1
    Sleep(30000)
    Else
    MsgBox(4096, "Message!", "Not on final screen yet!", 10)
    $InstallComplete = 0
    Sleep(30000)
    EndIf
Until $InstallComplete = 1

Using the ControlCommand, but that did not seem to work either. Ugh.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Try this :

$FinalScreen = ControlCommand("VIPRE Antivirus 2012", "", "[ID:1077]", "IsVisible")
Btw: You should you the ControlNN format instead of the ID which may change.

Br, FireFox.

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

If I wanted to click the button that I am looking for (in the same window) could I do this:

ControlClick("VIPRE Antivirius 2012","","[ID:1077]")

Assuming that 1077 is the control ID? Should I also use WinWaitActrivate to ensure the window is active? 

Share this post


Link to post
Share on other sites

Assuming that 1077 is the control ID?

Yes.

Should I also use WinWaitActrivate to ensure the window is active?

No, you don't need to activate the window if you use the Control* functions.

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

Doesn't the AV software have a silent install feature?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Most every AV company provides a silent install. And why would the text of the AV window be "Congrats! YOU ROCK!"? ;)


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

According to Google it should be something like this:

AgentInstaller-SITE-NAME-Workstations-General-EN.MSI /q /qn /promptrestart

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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
Sign in to follow this  
Followers 0