Jump to content

ControlSend what am I doing wrong?


Recommended Posts

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: ThunderRT6TextBox

Instance: 1

ClassnameNN: ThunderRT6TextBox1

Name:

Advanced (Class): [CLASS:ThunderRT6TextBox; INSTANCE:1]

ID: 4

Text:

Position: 84, 36

Size: 155, 23

ControlClick Coords: 67, 8

Style: 0x540100E0

ExStyle: 0x00000204

Handle: 0x000A0406

Link to comment
Share on other sites

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

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 like

ControlSend ("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 add

Opt("WinTitleMatchMode",2) to the beginning of your script

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Link to comment
Share on other sites

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...