Jump to content

looking for buttons in all the wrong places

Recommended Posts

Winwait ( 'Setup' , 'Welcome to the Audacity Setup' )
winactivate ( 'Setup' , 'Welcome to the Audacity Setup' )
while $i <= 1000

    $text = WinGetText("Setup", "")


        case (StringInStr($text, "Next"))
        ControlClick('Setup', '&Next >','' ) 

        case (StringInStr($text, "accept the agreement"))
        ControlClick("setup", "I &accept the agreement","" ) 

        case (StringInStr($text, "Install"))
        ControlClick("setup", "&Install", "" ) 

        case (StringInStr($text, "Finish")) 
        ControlClick("setup", "&Finish","" ) 


$i= $i + 1


there's the code.. what I'm trying to do is look for buttons and press them however, all it does is activate the window and then just run through it's alloted attempts at finding these buttons and exit with out pressing anything.

if you want to muck with it.. it's just to install Audacity.. found here:


I'm not sure why this isn't working.. I get no errors.. but it doesn't seem find the text either.


Link to comment
Share on other sites

You rock Larry.. as usual.

You know it's interesting, I had been using winexist before.. I was trying to optimise the script and thought I needed to use a string function to search for the buttons. I never realised I could use the second portion of winexists to look for the button text.. but it's so obvious now. (sheesh)

I knew the case order was going to be a pain in the @$$ but I was taking it one error at a time :(

Thanks so much for the help!


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

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...