Jump to content

If statement on "Visible Window Text"


Recommended Posts

Hi

I've managed to script a fairly useful tool for dealing with windows (2k) network password boxes. However, I need to refine it so that it only enters certain information for certain password boxes.

Can anyone tell me how to write a conditional statement when the "Visible Window Text" properties are as follows:

>>>>>>>>>>> Visible Window Text <<<<<<<<<<<

Please type your user name and password.

Firewall:

proxy.internet.point

Realm

&User Name

&Password

&Save this password in your password list

OK

Cancel

>>>>>>>>>>> Hidden Window Text <<<<<<<<<<<

many thanks

Link to comment
Share on other sites

Maybe:

$sWinText = WinGetText("Logon Window", "")
If StringInStr($sWinText, "Please type your user name and password") And StringInStr($sWinText, "Firewall:") And _
    StringInStr($sWinText, "proxy.internet.point") And StringInStr($sWinText, "Realm") Then
    ; Do something special...
    $a = $b
EndIf

Tweak the string checks to be a specific as you need.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Maybe:

$sWinText = WinGetText("Logon Window", "")
If StringInStr($sWinText, "Please type your user name and password") And StringInStr($sWinText, "Firewall:") And _
    StringInStr($sWinText, "proxy.internet.point") And StringInStr($sWinText, "Realm") Then
    ; Do something special...
    $a = $b
EndIf

Tweak the string checks to be a specific as you need.

:)

thanks I'll give this a try and let you know how it goes
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...