Jump to content

How do I wait for greyed out button to become Active


Recommended Posts

Hello,

I am new to AutoIt, I want to automate small UI wizard, I have been able to record all the action except the last stage where "Close" button is greyed out, untill the application finishes performing some tasks.

I tried using ControlCommand but somehow it did not work for me, may be I am not using it correctly.

I am copying my script here and also attaching snapshot of last page.

Can anyone help please?

Opt("WinWaitDelay",100)

Opt("WinDetectHiddenText",1)

Opt("MouseCoordMode",0)

_WinWaitActivate("New Project","Specify whether to c")

MouseClick("left",170,441,1)

MouseClick("left",588,565,1)

_WinWaitActivate("New Project","Please specify a pro")

MouseClick("left",588,565,1)

_WinWaitActivate("New Project","Select a project sou")

MouseClick("left",588,565,1)

_WinWaitActivate("New Project","Add project files or")

MouseClick("left",376,572,1)

MouseClick("left",682,568,1)

_WinWaitActivate("New Project","Please wait while th")

While Not ControlCommand('Activation', '', 'Close', 'IsEnabled', '')

Sleep(500)

WEnd

MouseClick("left",670,572,1)

#region --- Internal functions Au3Recorder Start ---

Func _WinWaitActivate($title,$text,$timeout=0)

WinWait($title,$text,$timeout)

If Not WinActive($title,$text) Then WinActivate($title,$text)

WinWaitActive($title,$text,$timeout)

post-66948-0-56462700-1314307903_thumb.p

Link to comment
Share on other sites

You want the General Help & Support part of the forum. This part of the forum is for finished examples only.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

Yes, this is in the wrong category, and a mod will move this whole thread soon. I use code like this to 'press' a button, then wait until the process is done.

ControlCommand("Forum Spam List Checker", "", "Button1", "Check")               ; Query/Search button
Do                                                                          ;
    Sleep(10)                                                               ;
Until ControlCommand("Forum Spam List Checker", "", "Button1", "IsEnabled")  ;Wait until Search/Query is done

While this is very similar to the way you are attempting to do the same thing, I think your failure is that the window title is probably 'New Project', not 'Activation'. Also, use the Info tool to get the ID of that close button. A function like ControlGetText can be used to get the actual text on a control, but using the ID will be better in this case I believe. Good luck with your project, and remember, the Help file will soon become your best friend!

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

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...