Greetings,
Any help is greatly appreciated. I'm a bit new to AutoIT, I have the help file and some examples and started in on a little project with some success, but also having some ill effects which I'm sure is due to my lack of knowledge of AutoIT.
Trying to send some key presses to another program from a Windowed AutoIT program. All is fine with the initial send of keys, but then that's it, I can't press my hotkey again, if I do, nothing happens. I fear that I'm not returning to my main func from the func for my hotkey. Or I'm just completely mucking up the code.
Could someone please look over my code and give me some hints as to what I'm possibly doing wrong?
Thanks in advance,
~Garrett
#include <GUIConstantsEx.au3>
#include <Constants.au3>
HotKeySet("!{F1}", "SendText1")
_Main()
Func _Main()
Local $exitbutton
GUICreate("FATE Hotkeys", 300, 200)
$exitbutton = GUICtrlCreateButton("Exit", 220, 166, 70, 24)
GUISetState()
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE Or $msg = $exitbutton
ExitLoop
EndSelect
WEnd
GUIDelete()
Exit
EndFunc
Func SendText1()
Local $hWnd = WinWait("[CLASS:FATE]", "", 0)
If WinExists("[CLASS:FATE]") Then
WinActivate($hWnd)
Send("{LCTRL down}")
Send("{LSHIFT down}")
Send("{~ down}")
Send("{LCTRL up}")
Send("{LSHIFT up}")
Send("{~ up}")
Send("fame")
sleep(10)
Send("{ENTER down}")
Send("{ENTER up}")
EndIf
EndFunc