Sign in to follow this  
Followers 0
plazma

controlsend

6 posts in this topic

Hello all,

Just getting into this AutoIT scripting and i've run into a problem with a GUI I'm creating. The GUI is essentially an auto dialer for a softphone. The app dials the access number, the language, pin number and then I have an input box for the phone number that needs to be dialed so I can just copy and paste the number into that input box and hit a dial button i've created and it dials everything i need without me having manually dial all of this stuff in (I do a lot of test calls for work so this would save me a lot of time).

I've got everything running nicely except for the part where i need to send the digits placed into the input box in the gui to the softphone. I've managed to get the digits copied from the input box with a simple GUICtrlRead($phone) ($phone being the var for the input box) and i then follow this up with a controlsend, i've tested the syntax by sending to a blank notepad doc so i know it works but the softphone i'm trying to send to doesnt seem to have any information to identify it in the control send paramaters.

I solved the lack of control information above for the access number etc with a simple send(digits) but i need to be able to send a controlsend("","","",(GUICtrlRead($phone)) with the title, text or control ID but the softphone doesnt have any of this information when looking at it on the AutoIT info tool.

How would i either

1. Get this information

2. Get around this problem

Any help would be appreciated.

Share this post


Link to post
Share on other sites



Does the AutoIt info tool basically report one main control for the entire softphone program? If so, you could use ControlClick and adjust the 7th and 8th parameters (x,y) to click the input box. Then you can send the phone number or paste it.

If the window is flexible in size, you can use WinGetPos to get the dimensions of the softphone program and appropriately calculate where to click before sending in the phone number.

Share this post


Link to post
Share on other sites

The softphone controls such as the "dial" "hangup" and number buttons each have their own control information but the phone itself has nothing, so the place where i need to send the input box text to has no information to send it to.

Here is a screen shot of the info tool while on the main phone itself.

http://img27.imageshack.us/img27/7974/infotool.jpg

Thanks for your advice, appreciate it.

I'm thinking maybe i could copy the input box text and just do a send but i cant do a send($phone) as it wants to send text not a variable.

I could do a bunch of controlcliks based on the outcome of the GUIctrlread data but this would be messy, the phone would probably cross DTMF as the digits are sent, I already had to delay the pin sending with an AutoItSetOption("SendKeyDelay", 600) as the phone was picking up the digits too fast and not dialing them all individually.

Share this post


Link to post
Share on other sites

Not sure if this is an acceptible solution but it'd be quick and dirty...

The info tool shows visible text of:

Line 3

Line 2

Line 1

You could get the window position, activate it, and click where needed -

;the x and y positions relative to the softphone gui, I grabbed these based on your info tool screenshot
$xOffset = 148
$yOffset = 95

$winPos = WinGetPos("","Line 3")
WinActivate("","Line 3")
MouseClick("left", $winPos[0] + $xOffset, $winPos[1] + $yOffset, 1, 0)
ClipPut($phone)
Send("^v")

If pasting it causes the aforementioned issue of going to fast then just use Send($phone)

Have you checked to see if your softphone program has any command line parameters?

EX:

softphone.exe /?

softphone.exe /help

If that doesn't work, check it's helpfile or any other .exe files in the same directory. If it does have cmd line params, this will be much easier.

Share this post


Link to post
Share on other sites

Hey thanks for the advice, I ended up downloading the SJphone (another softphone) which had loads of control and windows info to use, app is working like a charm.

Share this post


Link to post
Share on other sites

Hey thanks for the advice, I ended up downloading the SJphone (another softphone) which had loads of control and windows info to use, app is working like a charm.

Glad to hear 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