Sign in to follow this  
Followers 0
surfdork

Unable to get control click to function

6 posts in this topic

Hi ,

First of all I'm new to this application so please forgive the stupidity.

I am attempting to automate the install of an application, so far the only luck I've had is with launching the .EXE

I have not been able to figure out the following commands:

ControlCommand

GUICtrlRead

ControlClick

The first I'm attempting to recognize text in a combo box. My preference is to find a numerical identifier and base my choice upon that(this will help later).

Next, I'm just trying to send a command to a button, so far that is failing.

I've spent over 2 hours adding various parameters (unsuccessfully) to the commands. I'm totally lost and would appreciate any assistance.

Yes, I've read the help files and seached google.

I don't want to use macros, I really want to script all of this

Here's the script so far:

Run("C:\4878\setup.exe")

WinWaitActive("Choose Setup Language",5)

ControlCommand ( "Choose Setup Language", "Select the language for this installation from the choice below", 1005, "SelectString",'English')

;the above is not selectng from the droplist only from the displayed value, I verified this by entering thr string 'French" There is no focus on the selected item in the droplist

;GUICtrlRead ( 1005 ) this command gets the instance numbers from a combobox/droplist. I have not figured out how to pass it or verify the value extracted

sleep (500)

ControlClick ( "Choose Setup Language", "Select the language for this installation from the choice below",1007 , "right" , 1 , "" ,"" )

;This is not functioning, the 1007 is for the button Cancel, no focus on the buttom

Share this post


Link to post
Share on other sites



Adding attachment of the simple window I'm having issue with.

post-54659-1260139603238_thumb.jpg

Share this post


Link to post
Share on other sites

Help.

Seriously, I need assistance. I have spent all day trying to figure out how to get Auto It to successfuly recognize a window and send it a command, any command.

Notepad was easy however notepad is not what I'm trying to test.

Please, I just need some assiistance, I don't want the script to be written for me I just want to know why the following are not working for me.

Run("C:\Program Files (x86)\Microsoft Virtual PC\Virtual PC.exe")

If WinActive("New Virtual Machine Wizard",5) Then

MsgBox(0, "", "Window was active")

EndIf

The above fails to return a message box. My goal is to get confirmation the window is active and can receive a command

Run("C:\4878\setup.exe")

WinWaitActive("Choose Setup Language",5)

Send("{ENTER}")

or

Run("C:\Program Files (x86)\Microsoft Virtual PC\Virtual PC.exe")

WinWaitActive("New Virtual Machine Wizard",20)

How am I failing in recognizing the windows?

Share this post


Link to post
Share on other sites

There is an optional timeout parameter for WinWaitActive, but not for WinActive. In your codes, you are missing the text parameter for both of these functions.

Function WinActive

Function WinWaitActive


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

Thank you.

So now my understanding is that the following

WinWaitActive("New Virtual Machine Wizard", "", 5)

Only waits foor 5 seconds, it does not delay the recognition 5 seconds.

So this is pretty simple

Run("C:\4878\setup.exe")

WinWaitActive("Choose Setup Language")

Send("{ENTER}")

I don't even use the test parameter.

Thank you, this really helped me quite a bit. For a noob, the syntax can be a challenge to understand. Now, I have my entire install script working.

Again, thanks for your time.

Share this post


Link to post
Share on other sites

You bet. Glad you got it. :)


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

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  
Followers 0