Sign in to follow this  
Followers 0
jmiley

Hotkeyset question

3 posts in this topic

Hello everyone,

I hope this question doesn't sound too amateurish, but I've been having troubles setting a hotkey for a specific window.

Currently my script looks like:

HotKeySet("{Enter}", "remap_enter")
Func remap_enter()
If WinActive("Window Title") Then
        _IELoadWait($oIE)
        $oForm = _IEFormGetObjByName ($oIE, "form")
        _IEFormSubmit ($oForm)
        ReplaceText()
    Else
        send ("{enter}")
    endIf
EndFunc

The hotkey works perfectly on the specific window. However, the enter key won't work anywhere else except if the specific window is open.

Any suggestions out there?

Thank you!

Share this post


Link to post
Share on other sites



[autoit]HotKeySet("{Enter}", "remap_enter")

The hotkey works perfectly on the specific window. However, the enter key won't work anywhere else except if the specific window is open.

Any suggestions out there?

Thank you!

because this
If WinActive("Window Title") Then
you are telling the script to work only when the active window is "Window Title" when the active window is another window or the desktop the script send enter key then the func runs again and again and again....

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