Jump to content

Recommended Posts

Posted

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?

Posted

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

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
×
×
  • Create New...