Jump to content
Sign in to follow this  
david1337

Dialog Box that refers to a line in the script

Recommended Posts

david1337

Hi guys

I hope you can help me out with this. I don't know if it's possible, but here goes:

I am trying to create a script that will transfer calls in our phone system, to a specific phone number.

Here is a part of the script. The only important part is the line with the phone number.

Send("480")
Sleep(5000)
Send("808")
Sleep(1000)
Send("789456123") ;phone number
Sleep(1000)
Send("{#}")

What I want is:

When I start the script, a dialog box should open, saying something like: "Type in the phonenumber" and then a textfield where the person can type in a specific phone number.

So I want whatever phone number that is typed in to that textfield, to replace the Phonenumber in my above script. So once the phonenumber is typed in and the person push ENTER, the script will start from the beginning, and when it comes to that line with phone number, it will use the number that was typed in.

I hope you understand what I mean :-) Thanks!

Edited by david1337

Share this post


Link to post
Share on other sites
water

Something like this:

While 1
    $sInput = InputBox("Phone System", "Type in the phonenumber:", "", "", 200, 125)
    If @error <> 0 Then Exit
    If StringStripWS($sInput, 3) <> "" Then
        Send("480")
        Sleep(5000)
        Send("808")
        Sleep(1000)
        Send($sInput) ;phone number
        Sleep(1000)
        Send("{#}")
    EndIf
WEnd

But to make it reliable I would suggest to replace the Send statements with ControlSend.

  • Like 1

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
david1337

Something like this:

While 1
    $sInput = InputBox("Phone System", "Type in the phonenumber:", "", "", 200, 125)
    If @error <> 0 Then Exit
    If StringStripWS($sInput, 3) <> "" Then
        Send("480")
        Sleep(5000)
        Send("808")
        Sleep(1000)
        Send($sInput) ;phone number
        Sleep(1000)
        Send("{#}")
    EndIf
WEnd

But to make it reliable I would suggest to replace the Send statements with ControlSend.

 

THANKS mate it worked exactly the way I wanted it to!!!!

Share this post


Link to post
Share on other sites
water

:)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

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  

×