autohotkey - Send, SendInput, SendEvent functions entering single key multiple times -


i have created script in autohotkey.i have enter entire file path opened in file browser.i have used send function passes same keys multiple times. tried using function setkeydelay still enters keys multiple times. tried other alternatives sendinput , sendevent still didnt work. if terminate script in between , if control switches input box or editor, starts entering values area. send function keeps on entering keys after script execution terminated.

script:

;open adobe acrobat 8.  run acrobat.exe sleep, 1000   winwait, adobe acrobat professional,  sleep, 1000   ;open compare documents window  send, {alt}a   sleep, 1000   send, u   winwait, compare documents,   ;enter file path  ifwinnotactive, compare documents,  winactivate, compare documents,  winwaitactive, compare documents,  sleep, 1000   send, !h   winwaitactive, open,,1000  sleep, 1000   sendevent, "d:\sample\a.pdf" 

it enters text this

cccc:::::\\ddddiiiiii

things try:

update autohotkey latest version.

don't use sendevent. allows other input interrupt text being entered. use sendinput instead. recommended put following @ top of scripts:

#noenv  ; recommended performance , compatibility future autohotkey releases. sendmode input  ; recommended new scripts due superior speed , reliability. setworkingdir %a_scriptdir%  ; ensures consistent starting directory. 

sendmode input changes send use sendinput instead of sendevent. buffers input , sends @ once instead of letting other keyboard/scripts interrupt text. see: send more information.

restart computer , make sure there no other autohotkey programs running, or there isn't multiple instances of autohotkey script running. problem when testing, might have launched same script multiple times, , if thread hasn't been terminated, may have multiple instances there waiting open window activated. once open window has been activated, may have 4+ dormant scripts trying type @ same time, give output describing.


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -