Jump to content

Automated ControlClick() working first time only


Recommended Posts

I have a script I'm working on and I just about have it complete...save one piece of functionality. The script proceeds through 3 or 4 different screens (depending on the series of button clicks), but one of the automated ControlClick() commands works (welcome screen), but the same automated ControlClick() commands fails (defer screen). Can anyone provide some insight as to why the aforementioned ControlClick() isn't working, but the first one does? I've attached a basic flowchart of how the code is supposed to work as well as the code. Thanx in advance.

flowchart.png

code.txt

Link to post
Share on other sites

Another possibility is that your timer expires before the window shows up.  ControlClick would error out then. 

BTW, I cannot emphase it more, put some error handling in your code. It will not hurt you.  And at least you would know when a statement fails...

Link to post
Share on other sites

Danp2, blanking the text data element made no difference. As you'll note, the first welcome screen was already that way, but works without issue.

Nine, the expiration of the timer (while the defer screen is visible), is what is supposed to trigger the controlclick, as in the first welcome screen. Also, what suggestions would you make as pertains to error handling?

Link to post
Share on other sites

As @Danp2and I suggested, put some error handling.  One easiest way is to ConsoleWrite return value AND @error after each statement to understand which of the lines is failing.  The way you programmed your script is like a blind running a 100m.  He may get in the right direction and win.  But what happens when he runs against the crowd ?

Link to post
Share on other sites
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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By grimmlock
      Hey everyone
      I want to be able to press a button within a application however so far what I have tried does not seem to be working. I have successfully made the application (window) active, but when I try:

          WinActivate("- AdwCleaner - v4.109")     WinWaitActive("- AdwCleaner - v4.109")     send("{Tab}{Space}") ; even ("{TAB}{SPACE}")  

          WinActivate("- AdwCleaner - v4.109")     WinWaitActive("- AdwCleaner - v4.109")     ControlSend("- AdwCleaner - v4.109", "", "[CLASSNN:Button3]", "{SPACE}")  

          WinActivate("- AdwCleaner - v4.109")     WinWaitActive("- AdwCleaner - v4.109")     ControlClick("- AdwCleaner - v4.109", "Scan", "[CLASS:Button;INSTANCE:3]")  
      I have tried using the finder utility and that is how I got the Class and instance number but nothing is working. Could someone help?
      Thanks
      Grimm

×
×
  • Create New...