Jump to content

Send if text present


Recommended Posts

Still on the learning curve but can't quite figure out how to script this:

if TextPresentInWindow("blahblah") then send("yadayada")

Probably basic for the gurus here, but my brain is not cooperating.

<{POST_SNAPBACK}>

If WinWaitActive("title window","blahblah")  then send("yadayada")

The WinWaitActive is needed because the send can only send to an active windows.

Controlsend can be use to relax this constaint with an existing window :)

Link to comment
Share on other sites

Here's the code for this section. The program, when run, reports that either:

a) "SocketLock is Installed & Running" .. in which case I only want to send an "!x" to exit

or

B) "SocketLock is NOT Installed" .. in which case I want to send a "!i" and then the "!x"

On some of these little patchers, I can send the first keys regardless and they get ignored because there is no i option. For this one, the 'is installed' screen *still* responds to the Send even though the (supposedly) active key would be "Uninstall". This one uses both the U and I just as toggles to un/install. Grr.

FileInstall("F:\System CD\OS_Specific\XP\socketlock.exe", $tmpdir, 1)
    run($tmpdir & "socketlock.exe")
    WinActivate("Raw Socket Abuse Prevention System")
        sleep(1000)
    [I]if "SocketLock is NOT Installed" then send("!i")[/I]; need code
        sleep(1000)
        
    Send("!x");send eXit key
    Winwaitclose("Raw Socket Abuse Prevention System")
Edited by Xander
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...