Jump to content

Recommended Posts

Posted

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!

Posted

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...