The script below activates Visual Studio and then sends a key. I see the app gets activated but the key doesn't do anything. I tried different keys. However when I hit the same key manually after the app is activated through AutoIt, it works.
What am I doing wrong?
Opt("WinTitleMatchMode", 2) ; set to match part of title
If Not WinActive("Microsoft Visual Studio","") Then WinActivate("Microsoft Visual Studio","")
if 0 = WinWaitActive("Microsoft Visual Studio","") then
MsgBox(0, "Error", "Can't open Visual Studio")
Exit(1)
EndIf
Sleep(250)
;Send("{!f}")
;Send("{F1}")
Send("{LALT down}")
Send("{f}")