Jump to content

selecting options in a combo box


Recommended Posts

Hi

Im just trying to create my first script to automate some repetitive installations

I have got as far as the first combo box where I need to choose an option then continue with the installation, whats the best way to do this?

I have attached a word doco showing screen 1 then screen 2 of how far I have got, below is the script so far to get to this point:

MsgBox(0, "vodafone install", "click ok to continue the automated installation of the vodafone mobile connect version 9 software. Do not touch the keyboard or mouse during the installation.")

; Run the winzip installer

Run("\\beaker\install\Vodafone 3G Cards\Version 9 CD\setup_vmc.exe")

; Install location

WinWaitActive("Choose Setup Language")

Send("{ENTER}")

I have had a stab at selecting option 15 but failed, see below

; vodafone nz selection

WinWaitActive("Vodafone Mobile Connect Installer")

"[MsiDialogCloseClass:ComboBox;INSTANCE:15]",

the windows title is "Vodafone Mobile Connect Installer"

the class is "MsiDialogCloseClass"

basic control info = ComboBox

My other question is when I am going to put the visible text of a window in to the script and it happens to contain words which are commands how do I stop the script trying to action them? eg - below

< &Back

&Next >

Cancel

NewBinary23

NewBinary24

Please select your network operator...

Select the mobile network operator with whom you have an account, and then click Next.

NewBinary26

The InstallShield Wizard will install Vodafone Mobile Connect on your computer.

WARNING: This program is protected by copyright law and international treaties.

InstallShield

InstallShield

NewBinary22

Welcome to the InstallShield Wizard for Vodafone Mobile Connect

NewBinary25

Any help would be great

Thanks

install.doc

Link to comment
Share on other sites

Hi

Im just trying to create my first script to automate some repetitive installations

I have got as far as the first combo box where I need to choose an option then continue with the installation, whats the best way to do this?

I have attached a word doco showing screen 1 then screen 2 of how far I have got, below is the script so far to get to this point:

MsgBox(0, "vodafone install", "click ok to continue the automated installation of the vodafone mobile connect version 9 software. Do not touch the keyboard or mouse during the installation.")

; Run the winzip installer

Run("\\beaker\install\Vodafone 3G Cards\Version 9 CD\setup_vmc.exe")

; Install location

WinWaitActive("Choose Setup Language")

Send("{ENTER}")

I have had a stab at selecting option 15 but failed, see below

; vodafone nz selection

WinWaitActive("Vodafone Mobile Connect Installer")

"[MsiDialogCloseClass:ComboBox;INSTANCE:15]",

the windows title is "Vodafone Mobile Connect Installer"

the class is "MsiDialogCloseClass"

basic control info = ComboBox

You want ControlCommand():
#include <GUIConstantsEx.au3>

Global $hGUI, $ctrlCombo

$hGui = GUICreate("My GUI combo", 300, 300)
$ctrlCombo = GUICtrlCreateCombo("item1", 10, 10)
GUICtrlSetData(-1, "item2|item3|item4", "item4")
$ctrlButton = GUICtrlCreateButton("SET item2", 100, 250, 100, 30)
GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            ExitLoop
        Case $ctrlButton
            ControlCommand($hGui, "", $ctrlCombo, "SelectString", "item2")
    EndSwitch
WEnd

My other question is when I am going to put the visible text of a window in to the script and it happens to contain words which are commands how do I stop the script trying to action them? eg - below

< &Back

&Next >

Cancel

NewBinary23

NewBinary24

Please select your network operator...

Select the mobile network operator with whom you have an account, and then click Next.

NewBinary26

The InstallShield Wizard will install Vodafone Mobile Connect on your computer.

WARNING: This program is protected by copyright law and international treaties.

InstallShield

InstallShield

NewBinary22

Welcome to the InstallShield Wizard for Vodafone Mobile Connect

NewBinary25

Any help would be great

Thanks

If that is a comment, then put a semicolon at the start of each line, or wrap the region in #cs\#ce tags. If that is a string constant with newlines, the you have to assemble it with proper delimiters, i.e.:
$sString = '< &Back' & @CRLF & _
'&Next >' & @CRLF & _
'Cancel' & @CRLF & _
'NewBinary23' & @CRLF & _
'NewBinary24'

:)

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

Thanks for your reply

Isnt the code you suggested creating a new combo box as apposed to just selecting options from the existing one which is what I want to do?

Did you take a look at what im trying to do in the attachment?

I thought it would be along the lines of choosing option 15 from the combo box then sending enter?

Cheers

Link to comment
Share on other sites

Thanks for your reply

Isnt the code you suggested creating a new combo box as apposed to just selecting options from the existing one which is what I want to do?

Well, yes, it's just a demo showing the use of the function. You'll have to use it in your script, specifying your window, specifying your combo control, and the value you want selected. You're like the Waterboy: "You c'n DO EEeet!"

Did you take a look at what im trying to do in the attachment?

No.

I thought it would be along the lines of choosing option 15 from the combo box then sending enter?

Cheers

If you want to do it the hard way, look at the _GuiCtrlComboBox_* functions in the help file. You can select by index with _GUICtrlComboBox_SetCurSel() if you must, but ControlCommand() can too with "SetCurrentSelection" vice "SelectString".

Perhaps you should spend some time with the help file and learn ControlCommand() first.

:)

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

Do you know if there is an example some where of automating dropdown box selections in a similar scenario to install software with the desired options being selected?

If I can understand a similar example im sure I can figure it out, im just a bit lost without having one to learn from, I cant seem to find one on the web

Cheers

Link to comment
Share on other sites

Do you know if there is an example some where of automating dropdown box selections in a similar scenario to install software with the desired options being selected?

If I can understand a similar example im sure I can figure it out, im just a bit lost without having one to learn from, I cant seem to find one on the web

Cheers

I still don't know what is special about your particular combo box, because of a personal choice not to download unknown files from forum posts, like your install.doc in the OP. Others cruise the forum on a sandboxed VM or some such, and don't mind checking out posted files, so that might be just me. But there it is.

You might convert a screen shot to a compressed format (i.e. GIF or JPG, for Jon's hosting sake) and post it directly into your post. If you think it will help...

:)

Edit: At this time, the topic has over 40 views and the file still has 0 downloads, so I guess it's not just me. :)

Edited by PsaltyDS
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...