Jump to content
Macro Express Forums
Nathan

Mouse click on control breaks text type

Recommended Posts

I'm evaluating Macro Express and noticed that when I use a Mouse Click on Control prior to a Text Type (simulating keystroke <F5>) in SQl Server Management Studio, it stops the Text Type from functioning. When I remove the Mouse Click on Control function the Text Type function works. Is there a reason for this?

Share this post


Link to post
Share on other sites
1 hour ago, Nathan said:

 

Do you have a delay programmed between the mouse click and the F5 key?  If the system is busy with whatever activity is engendered by the click-on-control, it may be ignoring the F5.  

As a test, try the Timing command "Delay 3 Seconds" after the mouse click.  I know, three seconds is excessive, but the point is just to test whether the problem is in Macro Express or in feeding the application a keystroke it is not ready to handle. 

Share this post


Link to post
Share on other sites

Now, whittle the delay down to discover how short is actually needed. You may find you only need a few hundred milliseconds.

Share this post


Link to post
Share on other sites

Or code the macro to "watch" for something to change on the screen, indicating that the click-on-control has completed.  For example, the code below will loop until a particular color is found at a screen location.  The conditional loop avoids always having to wait for the maximum time that MIGHT be required, before typing the F5 key.  This loop waits nominally 50 seconds before typing F5, but will go to F5 almost instantly if the screen change is detected. 

//  
// Wait for tab to turn green
Mouse Move Screen 350, 420
Repeat Start (Repeat 500 times)
  Get Pixel: Under Mouse into %N1%
  If Variable %N1% = 2314301
    Repeat Exit
  End If
  Delay 100 Milliseconds
Repeat End
//  
Text Type F5

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

×