Sign in to follow this  
Followers 0
THenrich

None of Send keys work after window is activated

3 posts in this topic

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}")

Share this post


Link to post
Share on other sites



Remove the curly braces, so Send("{!f}") becomes Send("!f"). Also, the If loop is wrong. It should be If WinWaitActive = 0, not If 0 = WinWaitActive. Well now that I think about it, maybe it doesn't matter, but it looks wrong to me.


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

AutoIt seems to interfere with my computer in an odd way. It messes with my shortcuts on my computer, mouse clicks and key presses do odd things. I had to reboot twice and make sure AutoIt is the cause of this behavior. I ended up with uninstalling it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0