clipboard/hotstring problem

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Kaspa182
Posts: 5
Joined: 28 Oct 2020, 09:41

clipboard/hotstring problem

Post by Kaspa182 » 05 Aug 2021, 06:12

Hello
so this is my script bellow, it works almost good, the problem is with this one, that the first time at day i turn on this script and use hotkey to copy 3 numbers and write hotstring command the first my war isnt writen, but if i f.x cory the first number 2 times all 3 wars ar writen with hotstring command, or if i write that hotstring the time i tun the script on and then i copy 3 numbers with hotkey it also works just fine it writes all 3, and i have noooo idea what in the heaven is wrong in this scrip, could u pls help me with that? If You ofc. understood what i have in mind :) Thank you in advance.

Code: Select all

!x::
Clipboard = 
Send, ^c
ClipWait, 2
if errorlevel
{ MsgBox, The attempt to copy text onto the clipboard failed.
	return
}
MyVar%count% := Clipboard
count ++
Return
::brug::
WinWaitActive, tbp0 - Micro Focus Rumba
send, Har brugt info fra police nr. %MyVar1% %MyVar2% %MyVar3% til at udstede ny
MyVar1 := 
MyVar2 :=
MyVar3 :=
sleep, 200
;Clipboard = 
Sleep, 200
count = 1
return
User avatar
mikeyww
Posts: 26602
Joined: 09 Sep 2014, 18:38

Re: clipboard/hotstring problem

Post by mikeyww » 05 Aug 2021, 06:50

Perhaps:

Code: Select all

Start:
count := 1, MyVar1 := MyVar2 := MyVar3 := ""
Return

!x::
KeyWait, Alt
SoundBeep, 1500
Clipboard = 
Send ^c
ClipWait, 2
If ErrorLevel
 MsgBox, The attempt to copy text onto the clipboard failed.
Else MyVar%count% := Clipboard, count++
Return

::brug::
WinWaitActive, tbp0 - Micro Focus Rumba
Send, Har brugt info fra police nr. %MyVar1% %MyVar2% %MyVar3% til at udstede ny
Gosub, Start
Return
Post Reply

Return to “Ask for Help (v1)”