Sign in to follow this  
Followers 0
Guest Luzifer2004

easy question to window conditions

2 posts in this topic

just tested some conditions myself but need some help anyway.

my aim is something like that:

run notepad

check weather notepad have focus

write a sentence 10000 times ^^ (for loop)

check in every loop weather notepad have focus or something else just opened

if notepad have focus -> simply go on

if not -> activate notepad again

heres my code that activates the window after each word.

so i avoided the conditions but the program is slower.

AutoItSetOption("SendKeyDelay", 100)
msgbox (64, "tut", "es geht los")
Run("notepad.exe")
WinWaitActive("Unbenannt - Editor")
for $i=1 to 100000
    Send("ich ")
    WinActivate("Unbenannt - Editor")
    Send("bin ")
    WinActivate("Unbenannt - Editor")
    Send("der ")
    WinActivate("Unbenannt - Editor")
    Send("beste ")
    WinActivate("Unbenannt - Editor")
    Send("hier ")
    WinActivate("Unbenannt - Editor")
Next
msgbox (0, "tut", "ende")

can someone write what code i have to build in?

thx for help, sorry for grammar and short, incomplete sentences (german and lack of time^^)

Share this post


Link to post
Share on other sites



Why don't you use ControlSend -- that's saver than send (at least I think so).

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