Jump to content

GUI Interface questions


Recommended Posts

Friend of mine has a website where he sells products. He has a customer base that has ordered from him in the past and he wants a text messaging program / script to send promotional messages to people that have already purchased his products. He has their names and phone numbers in an excel document. I have made a simple GUI with GUI Builder + and I have made a button that opens a file browser to select the csv file but I don't know the code to save the file or file path as a variable that I can then use it to check for the right number of characters and make sure there are no illegal characters etc. I am trying to use google voice to send the messages with sendgvsms.au3 which I believe needs to be tweaked because google made some changes when they discontinued hangouts because there was an au3 file in the example scripts that utilizes it. Is there a better more current way to do this? 

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <_sendGVSMS.au3>
#include <File.au3>

#Region (=== GUI generated by GuiBuilderPlus 1.0.0-beta4 ===)
Global $hGUI = GUICreate("Batch Text Messager", 824, 635, 1024, 545)

Global $Message = GUICtrlCreateInput("0", 20, 366, 781, 140)
GUICtrlCreateUpdown(-1)
GUICtrlSetFont(-1, 16)
Global $Label_1 = GUICtrlCreateLabel("Message Text", 30, 323, 151, 31)
GUICtrlSetFont(-1, 16)
Global $Imported_Phone_Numbers = GUICtrlCreateInput("Phone Numbers", 460, 60, 341, 270)
GUICtrlCreateUpdown(-1)
GUICtrlSetFont(-1, 16)
Global $ImportPhoneNumbers = GUICtrlCreateButton("Import Phone Numbers", 100, 110, 211, 31)
Global $Label_2 = GUICtrlCreateLabel("Click on the Import Phone Numbers button.    Phone numbers must be in CSV format.", 10, 40, 401, 51)
GUICtrlSetFont(-1, 16)
Global $Label_3 = GUICtrlCreateLabel("Imported Phone Numbers", 480, 20, 251, 31)
GUICtrlSetFont(-1, 16)
Global $SendToAll = GUICtrlCreateButton("Send To All", 610, 525, 171, 31)
Global $Exit = GUICtrlCreateButton("Exit", 610, 580, 171, 31)
#EndRegion (=== GUI generated by GuiBuilderPlus 1.0.0-beta4 ===)

_main()

;------------------------------------------------------------------------------
; Title...........: _main
; Description.....: run the main program loop
;------------------------------------------------------------------------------
Func _main()
    GUISetState(@SW_SHOWNORMAL)

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop

            Case $ImportPhoneNumbers
                _importPhoneNumbers()

            Case $SendToAll
                _sendMessages()

            Case $Exit
                Terminate()

        EndSwitch
    WEnd
EndFunc   ;==>_main

Func _importPhoneNumbers()
            Run("C:\WINDOWS\EXPLORER.EXE")  

        EndFunc

Func _sendMessages()
            MsgBox(0,"title","message 2")
        EndFunc

Func Terminate()
    Exit 0
EndFunc

 

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Link to comment
Share on other sites

Func _importPhoneNumbers()
    $s_file = FileOpenDialog("Select a file",@ScriptDir & "\","All Files (*.*)")
        If @error Then
            MsgBox(4096,"","No File(s) chosen or bad filter")
        Else
            MsgBox(0,"Title",$s_file)
        Exit
EndIf
EndFunc

Looks like this places the file location in the value of $s_file. Now I just need to make the rules for parsing the data. 

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

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...