Jump to content
Sign in to follow this  
GKWong

[Help]|Trying my first autoit script

Recommended Posts

GKWong

I got a problem with this script:-

WinWaitActive("Document - WordPad")

HotKeySet("{End}","MyExit")

HotKeySet("{PGUP}","BlueTxt")

Func MyExit()

Exit

EndFunc

Func BlueTxt()

Send("Hello World{Enter}")

EndFunc

What i am trying to do is if WordPad is running, then if i press PageUp key, it will type Hello World and then press Enter. If End key is press then it will exit.

But the main problem is the script auto exit when WordPad is active. How to solve this?

Share this post


Link to post
Share on other sites
Aassdd

WinWaitActive("Document - WordPad")

HotKeySet("{End}","MyExit")
HotKeySet("{PGUP}","BlueTxt")

While 1
    Sleep(100)
WEnd

Func MyExit()
Exit
EndFunc

Func BlueTxt()
Send("Hello World{Enter}")
EndFunc

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  

×