Sign in to follow this  
Followers 0
thuun

Let's click some buttons

5 posts in this topic

This seems a very simple task, somehow the best answer is not finding me. <_<

I would like to generate this proposed autoit script when as an app is run, so it should be short.

it starts like this, a prog. is run ..

if not (ProcessExists("prog.exe")) then run("prog.exe -genhash -envids")

the prog and switches don't matter.

When the prog process is a done, a ui button called 'done', needs to be clicked.

button 1 'cancle', is active during processing, button 2, 'done', becomes active on completion of processing.

I'm wondering if a loop should be used or a wait command will work will some formatting variations.

Thx in advance, -t

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Yes a loop will be needed, check out these commands in the help file. ControlCommand, and ControlClick.

Edited by Thatsgreat2345

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I've actually may have just figured out a cmdline script that solves the issue. I checked the docs and some examples, but I'm still looking for just the right command or commands to click a button on a hung proccess using autoit. I'll check some more though.

Edited by thuun

Share this post


Link to post
Share on other sites

Good job on coming up with a solution on your own <_<

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I finally came up w/the following which will wait for and click a button, pulling into active focus if need be.

Do
If ControlFocus("TitleBar - Here", "","Button1") = 1 Then
ControlClick("TitleBar - Here", "","Button1")
Else
Sleep(500)
Endif
Until ProcessExists($PID) = 0

'ControlFocus' was the command I needed.

<_<

Edited by thuun

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