smellyfingers Posted January 19, 2015 Share Posted January 19, 2015 Hi all, I just have 1 simple question, i use ControlSend to fill info into a programs controlinputs, however sometimes it sends a character instead, Example winwaitactive("myWin") clipput("myInfo") sleep(100) controlfocus("myWin","","[CLASSNN:Ahx:233223]") ControlSend("","","","^v") This sends the v instead of pasting from clipboard (sometimes), would it be safer to have it send as a variable instead? Many thanx! Link to comment Share on other sites More sharing options...
jdelaney Posted January 19, 2015 Share Posted January 19, 2015 (edited) Use ControlSetText() if you can. controlfocus("myWin","","[CLASSNN:Ahx:233223]") ControlSetText("myWin","","[CLASSNN:Ahx:233223]",ClipGet()) ; else try ControlSend("myWin","","[CLASSNN:Ahx:233223]",ClipGet()) Edited January 19, 2015 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
smellyfingers Posted January 19, 2015 Author Share Posted January 19, 2015 I have tried that but the program doesn't trigger that a change is made that way it only responds to send and tab , i just wonder how it can fail to make a CTRL + V and only send a simple character? I'm thinking that maybe it does the CTRLDOWN and CTRLUP before the v ? Maybe a workaround would be while Controlgettext <> myInfo, controlsettext "", Paste or send, Controlgettext ? Link to comment Share on other sites More sharing options...
SadBunny Posted January 19, 2015 Share Posted January 19, 2015 Have you try playing with the SendKeyDownDelay and SendKeyDelay options? As in (help file):Opt("SendKeyDelay", 5) ;5 millisecondsOpt("SendKeyDownDelay", 1) ;1 millisecond... but with bigger values? Their default values are 5, and I don't know what kind of application it is, but if stuff goes wrong with sending keystrokes (which I often get with non-standard window controls), that's always my first trial&error option. I don't really see where it would help with key combos with ctrl/shift/alt, but you never know. No matter how cool AutoIt is, simulating keystrokes remains very useful but murky business Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now