twiggy Posted May 22, 2012 Share Posted May 22, 2012 Hi'ya all;Been working on my 1st script - and as I've done some batch files long ago, I figured "this can't be that hard" expecially cause I'm doing what seems to be simple. I need to launch an .exe, in the 1st box I choose from a dropdown list (the script works fine up to this point) - then send some text to the input box (This is where I'm trying to use ControlSend), and then click OK (the Send ("{ENTER} will work fine as long as there is something in the input box) - I am getting no output in my input box.Thanks much !!So here's my script and some info on from the Au3Info for the input box I'm trying to fill:;SMSdb - must have Activelink running and logged in for the updates and imports to work.Run("C:\Program Files\SMSdb\Activelink.exe")sleep(30000)ControlCommand ("Level", "", "[CLASS:ThunderRT6ComboBox;INSTANCE:1]","SelectString", "UILevel")Sleep (20000)ControlSend ("Level", "", "[CLASSNN:ThunderRT6textbox;INSTANCE:1]", "UpdatesImports");ControlCommand ("Level", "", "[CLASS:ThunderRT6textbox;INSTANCE:1]", "AddString", "UpdatesImports");ControlCommand ("Login", "OK", "[CLASS:ThunderRT6CommandButton;INSTANCE:1]", "OK");Send ( "{ENTER}")Exit>>>> Control <<<<Class: ThunderRT6TextBoxInstance: 1ClassnameNN: ThunderRT6TextBox1Name: Advanced (Class): [CLASS:ThunderRT6TextBox; INSTANCE:1]ID: 4Text: Position: 84, 36Size: 155, 23ControlClick Coords: 67, 8Style: 0x540100E0ExStyle: 0x00000204Handle: 0x000A0406 Link to comment Share on other sites More sharing options...
twiggy Posted May 24, 2012 Author Share Posted May 24, 2012 HI - Update to my post I changed my command line to just Send, and it works - I'd rather be using ControlSend as if the curser dosen't end up where it needs to be when it hits the Send command, then the scripts purpose will fail, but for now, at least I have something. Really like to know why ControlSend isn't working for me. Thanks Link to comment Share on other sites More sharing options...
kaotkbliss Posted May 24, 2012 Share Posted May 24, 2012 you can use WinWait, WinWaitActive or even a loop checking for WinExists instead of sleep so that you don't end up trying to send before the window is available or waiting long after the window has popped up.also, I would write the ControlSend likeControlSend ("Level", "", "[CLASS:ThunderRT6textbox;INSTANCE:1]", "UpdatesImports")Is "Level" the actual title of the window? if it is only part then you want to either use the complete full window name or addOpt("WinTitleMatchMode",2) to the beginning of your script 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy! Link to comment Share on other sites More sharing options...
twiggy Posted May 24, 2012 Author Share Posted May 24, 2012 kaotkbliss;Hot Dam, thanks!!!!!! - it ended up bing a Uppercase\lowercase issue - I had ThunderRT6textbox and it should have been ThunderRT6TextBox - but you suggesting I change my Sleep to WinWait, is what cause me to catch the "spelling" issue.Thank you, Thank you, Thank 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