Jump to content
Sign in to follow this  

CommandControl "SetCurrentSelection", occurrence

Recommended Posts



Thank you in advance for your patience since I'm new to using AutoIT

I want to use controlcommand to select items from a droplist for language selection

The following does not appear to work, French is not selected

ControlCommand ( "Choose Setup Language", "","ComboBox1", "SelectString",'French(France)')

So, I'd like to use ControlCommand "SetCurrentSelection", occurrence because of localization issues, French will not looks the same when installing on a Chinese system

I have no idea whar occurence refers to.

Is it a numerical count of the entries from top down?

What value am I to enter in occurence and with what syntay (do I enter a "occurance" for example)?

Am I even using the right function to accomplish this task?

Heres the script so far


WinWaitActive("Choose Setup Language")

sleep (500)

ControlCommand ( "Choose Setup Language", "","ComboBox1", "ShowDropDown","")

;Should I enter a hide dropdown after this command. The show is to give visual indication the droplist is active.

sleep (500)

ControlCommand ( "Choose Setup Language", "","ComboBox1", "SelectString",'French(France)')

;I have no idea so far if French is selected.

sleep (500)

ControlClick ( "Choose Setup Language","" ,"[iD:1006]")

;Send("{ENTER}") this always works

Thank you for your patience

Share this post

Link to post
Share on other sites

"Occurrence" is a 0-based index (not at all clear from the help file description). So, if you know French is the third option in the list, it would be:

ControlCommand("Choose Setup Language", "", "ComboBox1", "SetCurrentSelection", 2)


Edit: Typo.

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

Share this post

Link to post
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
Sign in to follow this