Jump to content

Selecting an option from a dropdown menu


Recommended Posts

Greetings to all, I am new to this whole scripting thing, so i will describe what i am trying to do. I am trying to script an install that at one point during the setup has a drop down menu, when setup gets to this point, i need to select an option from that menu before clicking next to go to the next screen. what do i need to do in my script in order to make it happen? I really know nothing about this (what syntax to use, or if i just call it by the name in the drop down list, or if they are numbered) any help with this situation would be greatly appreciated! thank you all!

Link to comment
Share on other sites

I started to just refer you to the help file example for GuiCtrlCreateCombo(), but that is one pathetic demo script (they're usually quite good). Try this one:

#include <GUIConstants.au3>

; Create a GUI centered on the desktop
GUICreate("Combo Demo", 200, 100)
$Combo_1 = GUICtrlCreateCombo("item1", 10, 10, 180, 20) ; create first item
GUICtrlSetData(-1, "item2|item3", "item3") ; add more items, set a new default
$Button_1 = GUICtrlCreateButton("SELECT", 70, 50, 60, 30)

; Make the GUI visible
GUISetState()

; Run the GUI until the dialog is closed
While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            ExitLoop
        Case $Button_1
            MsgBox(64, "Read Combo", "You selected: " & GUICtrlRead($Combo_1))
    EndSwitch
WEnd

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Im not creating the setup, it is an actual setup (ultravnc) that i am scripting for ease of installing. i just need to know the syntax for selecting options from a drop down menu. thanks again in advance.

Link to comment
Share on other sites

Im not creating the setup, it is an actual setup (ultravnc) that i am scripting for ease of installing. i just need to know the syntax for selecting options from a drop down menu. thanks again in advance.

Sorry, misunderstood to goal here. :">

Check out ControlCommand(), or the UDF GuiCombo.au3 which has stuff like _GUICtrlComboSetCurSel() in it.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...