Jump to content

Hotkey


Recommended Posts

Hello,

I've made a script, but it's not working. What is wrong?

HotKeySet("{PRINTSCREEN}", "MyFunction")

BlockInput(1)

Run("Notepad.exe")

WinWaitActive("Notepad")

Send("Hello, How are you? This is a test")

Func MyFunction()

BlockInput(0)

EndFunc

Thanks,

PcExpert

Link to comment
Share on other sites

WinWaitActive("Notepad") should be WinWaitActive("Untitled")

but the block input will block you from using any HotKeys.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

Ok, thanks. So that means that you cannot stop a script from being excuted?

You can block input but you have to remember to unblock it.

BlockInput(1)

Run("Notepad.exe")

WinWaitActive("Untitled")

Send("Hello, How are you? This is a test")

BlockInput(0)


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

  • Moderators

But I can't assign a hotkey to it? And there's no other way to do it?

Not if your going to block the keys from use (external stopping that is). You could always use the Ctrl+Alt+Del method, and in the script if ProcessExists('tskmgr.exe') or something, then exit or unblock that way.

Edit:

Or use some type of timing method.

These are internal ideas only.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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...