AHK Struggles to Enter Values into ComboBox
I am writing an AHK script t开发者_Go百科o automate data entry into a GUI form. There is a drop-down box with a few hundred entries. I know the value I want to select and when I manually type in the number the combo box changes to the appropriate value. When I send the same string in AHK (using Send) it chooses the first item on the list. I have played around with various values of SetKeyDelay (-1 through 2000).
SetKeyDelay 1000
Send %ItemNumber%
SetKeyDelay -1
Any suggestions here?
Thanks
Jonathan
Have you tried other send modes? (Like SendInput, SendPlay, etc...)
Also, if it's a standard Windows combobox, it might be more precise to use messages (like CB_SETCURSEL).
Turns out there was a line up top that was messing me up:
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SendInput ignores the value of SetKeyDelay; the above line was converting all of my "Send"s to "SendInput"s
Thanks-
Jonathan
精彩评论