I am using a dictionary program for PC. when I'm typing on the search bar of the application I should press Enter every time after I finish typing the word(s) so that the program search for the word. I want an autohotkey script for the application in order to automatically sending Enter after I finished typing the word. so the script should automatically send Enter after I didn't type for instance for 0.75 second at the end of typing ( I'm doing touch typing so I assume it takes less than a 0.75 second for me to press two buttons although the time might be adjustable). So can you please help me with this?
Thanks in advanced!
Script for sending Enter automatically after finishing the typing Topic is solved
-
- Posts: 69
- Joined: 01 Sep 2020, 12:28
Re: Script for sending Enter automatically after finishing the typing
Code: Select all
#InstallKeybdHook
lag := 500
Loop {
WinWaitActive, ahk_exe notepad.exe
Sleep, lag
SoundBeep, 1500
SetTimer, Check, 100
WinWaitNotActive
SetTimer, Check, Off
SoundBeep, 1000
}
Check:
last := typing, typing := A_TimeIdleKeyboard < lag
If !last || typing
Return
Send {Enter}
SoundBeep, 1700
Return
-
- Posts: 69
- Joined: 01 Sep 2020, 12:28
Re: Script for sending Enter automatically after finishing the typing
Thanks, but unfortunately it didn't work.mikeyww wrote: ↑11 Apr 2021, 13:02Code: Select all
#InstallKeybdHook lag := 500 Loop { WinWaitActive, ahk_exe notepad.exe Sleep, lag SoundBeep, 1500 SetTimer, Check, 100 WinWaitNotActive SetTimer, Check, Off SoundBeep, 1000 } Check: last := typing, typing := A_TimeIdleKeyboard < lag If !last || typing Return Send {Enter} SoundBeep, 1700 Return
Re: Script for sending Enter automatically after finishing the typing
Change "notepad" to match your own program.
-
- Posts: 69
- Joined: 01 Sep 2020, 12:28
Re: Script for sending Enter automatically after finishing the typing
I did but still doesn't work( it worked in notepad)
It is a screen shot of windows spy for the application should I use "Oxford Advanced Learner's Dictionary" after Winactivate, ?
Also I wrote the script under
Code: Select all
#IfWinActive Oxford Advanced Learner's Dictionary
- Attachments
-
- 2021-04-11 21_57_02-Window Spy.png (22.45 KiB) Viewed 640 times
Re: Script for sending Enter automatically after finishing the typing Topic is solved
#IfWinActive works only for hotkeys & hotstrings. You could try the following.
Code: Select all
#InstallKeybdHook
lag := 500
Loop {
WinWaitActive, Oxford Advanced Learner
Sleep, lag
SoundBeep, 1500
SetTimer, Check, 100
WinWaitNotActive
SetTimer, Check, Off
SoundBeep, 1000
}
Check:
last := typing, typing := A_TimeIdleKeyboard < lag
If !last || typing
Return
Send {Enter}
SoundBeep, 1700
Return
-
- Posts: 69
- Joined: 01 Sep 2020, 12:28
Re: Script for sending Enter automatically after finishing the typing
Thank you very much! I opened another file and put the script and it works now! but is it possible to do it somehow without the annoying beep beep sounds? Also it sends Enter several times instead of one time.mikeyww wrote: ↑11 Apr 2021, 13:38#IfWinActive works only for hotkeys & hotstrings. You could try the following.
Code: Select all
#InstallKeybdHook lag := 500 Loop { WinWaitActive, Oxford Advanced Learner Sleep, lag SoundBeep, 1500 SetTimer, Check, 100 WinWaitNotActive SetTimer, Check, Off SoundBeep, 1000 } Check: last := typing, typing := A_TimeIdleKeyboard < lag If !last || typing Return Send {Enter} SoundBeep, 1700 Return
Re: Script for sending Enter automatically after finishing the typing
You can certainly delete the beep lines.
You might want to increase the lag.
You might want to increase the lag.
-
- Posts: 69
- Joined: 01 Sep 2020, 12:28