Starbug Posted September 22, 2007 Posted September 22, 2007 searching fourms, found nothing relating to this problem I was wondering if somebody can show me how to set a variable in a script. i was guessing the following will set variable combo_1 to macmail $combo_1 = ("MACMAIL") then i want to Send the variable as keystrokes iv tried a few combonation of the below, but no luck Send ("$Combo_1" [, flag = 1] ) help files say Note, by setting the flag parameter to 1 the "keys" parameter is sent RAW. This is useful when you want to send some text copied from a variable and you want the text sent exactly as written. My finished task will be a GUI (1/2 created) that has 2 dropdown menus, and to text entries i want to select the drop down menu, type in box. select 2nd drop down menu, type in box then output all the 4 controls to a string of keystrokes to a program i use at work. If u can understand how to output variables as keystrokes ill be almost finished with it (i think) if your interested, my 1/2 done GUI is below. ; Script generated by AutoBuilder 0.6 Prototype #include <GuiConstants.au3> #Include <GuiCombo.au3> GuiCreate("***************", 480, 255,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Combo_1 = GuiCtrlCreateCombo("Reps location", 20, 20, 160, 21) _GUICtrlComboDeleteString (-1, 0) $Input_2 = GuiCtrlCreateInput("", 270, 20, 190, 20) $Combo_4 = GuiCtrlCreateCombo("advised for", 20, 60, 440, 21) _GUICtrlComboDeleteString (-1, 0) $Input_5 = GuiCtrlCreateInput("", 20, 100, 440, 80) $Button_6 = GuiCtrlCreateButton("Advise!", 180, 200, 110, 30) GUICtrlSetData($Combo_1, "ONDSL - |ONHSD - |CVGDSL - |CVGHSD - |UCMS - ") GUICtrlSetData($Combo_4, "----For DSL: ----|1. A-NUM : |2. Template : |3. RPTDSL : |4. Incorrect Symptom : |5. Other : |6. PPPoA : |----For HSD: ----|1. Template : |2. Incorrect booking : |3. Other : ") GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;; EndSelect WEnd Exit
narayanjr Posted September 22, 2007 Posted September 22, 2007 (edited) Send ($Combo_1 , 1) Edited September 22, 2007 by narayanjr
Starbug Posted September 22, 2007 Author Posted September 22, 2007 Awesome!! works in my little test script! would i be correct in saying that if i enter text into either test input ($Input_5 = GuiCtrlCreateInput) it will set the variable to the value entered? and would that also mean that if i choose an item from the dropdown menu, it will also set the variable to whats selected?? thanx fopr the help!
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