TheLandYacht Posted July 17, 2009 Share Posted July 17, 2009 Two questions about the script mentioned below. This is copied from another thread. 1. In the below example (found in another thread, just edited the CONTENT), you select an option in the dropdown menu, then click the RETRIEVE VALUE button to get the result. I am trying to design a similar drop-down menu for non-mouse use, so how would I change this to react to an enter-key press? In other words, use up/down arrows to select the menu item i want, then enter to display the result. 2. WHEN you hit the retrieve value button, it pops up a MsgBox with the output. How would you change this to send the output as text to the program behind it(in this case, Cricket Wireless' text messaging software)? These questions are because I am trying to build a simple phonebook for my Cricket Wireless network dongle's text messaging function. I'd like to keep a list of my most often used contacts in a dropdown, so i can just arrow down to the one I want, hit enter, & have the script paste the number into the appropriate field of the Cricket Wireless software so I can send the person a text from my computer. Thanks in advance for any thoughts. expandcollapse popup#include <GUIConstantsEx.au3> #include <GUIComboBox.au3> Dim $aData[3][2] $aData[0][0] = "Joe Smith" $aData[0][1] = "5125551212" $aData[1][0] = "Jim Green" $aData[1][1] = "5125553131" $aData[2][0] = "Sally Fields" $aData[2][1] = "5125556464" $hGUI = GUICreate("My GUI combo",300,100) ; will create a dialog box that when displayed is centered $hCombo = GUICtrlCreateCombo("", 10, 10,"","",$CBS_DROPDOWNLIST) ;$hCombo = _GUICtrlComboBox_Create($hGUI, "", 2, 2, 296, 20,$CBS_DROPDOWNLIST ) ;Populate For $X = 0 to Ubound($aData)-1 GUICtrlSetData($hCombo,$aData[$X][0]) ;_GUICtrlComboBox_AddString($hCombo,$aData[$X][0]) Next $hButton = GUICtrlCreateButton("Retrieve Value",100,40,100) GUISetState() ; Run the GUI until the dialog is closed While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $hButton MsgBox(0,"",$aData[_GUICtrlComboBox_GetCurSel($hCombo)][1]) EndSwitch WEnd Link to comment Share on other sites More sharing options...
TheLandYacht Posted July 18, 2009 Author Share Posted July 18, 2009 (edited) OK, finally ended up with the code below, which seems to work as I'd like it to. Is it possible to add a second dropdown menu with something like the following format? DDM1: joe smith = 5125551212 jim green = 5125553131 sally fields = 5125554141 DDM2 on my way = "enroute, my eta is (ASK ME FOR INPUT)" random message = "yadda yadda" random msg 2 = "blah blah" with the output looking like... (activate "SMS Messages")(Pause .5sec)(alt-t)(choice from DDM1)(tab)(choice from DDM2) Problems are... 1. can't figure out how to build a second DDM without breakin the first one. 2. Must be doin somethin wrong, cuz if I add "Send("!f")" between lines 58 & 59, which is where it appears to go if I follow the above output plan, it breaks windows to the point I have to hard-reset. expandcollapse popup#include <GUIConstantsEx.au3> #include <GUIComboBox.au3> #include <Misc.au3> Dim $aData[3][2] $aData[10][0] = "test2" $aData[10][1] = "5125556464" $aData[11][0] = "test3" $aData[11][1] = "5125556464" $aData[12][0] = "test4" $aData[12][1] = "5125556464" $hGUI = GUICreate("Phonebook",300,100) ; will create a dialog box that when displayed is centered $hCombo = GUICtrlCreateCombo("", 10, 10,"","",$CBS_DROPDOWNLIST) ;$hCombo = _GUICtrlComboBox_Create($hGUI, "", 2, 2, 296, 20,$CBS_DROPDOWNLIST ) ;Populate For $X = 0 to Ubound($aData)-1 GUICtrlSetData($hCombo,$aData[$X][0]) ;_GUICtrlComboBox_AddString($hCombo,$aData[$X][0]) Next $hButton = GUICtrlCreateButton("Send to Cricket",100,40,100) GUISetState() ; Run the GUI until the dialog is closed While 1 SendKeepActive("SMS Messages") If _IsPressed("0D") Then If WinActive("Phonebook") Then Send($aData[_GUICtrlComboBox_GetCurSel($hCombo)][1]) EndIf EndIf Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $hButton MsgBox(0,"",$aData[_GUICtrlComboBox_GetCurSel($hCombo)][1]) EndSwitch WEnd Edited July 18, 2009 by TheLandYacht 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