Nathan Posted November 1, 2018 Report Share Posted November 1, 2018 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? Quote Link to comment Share on other sites More sharing options...
rberq Posted November 1, 2018 Report Share Posted November 1, 2018 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. Quote Link to comment Share on other sites More sharing options...
Nathan Posted November 2, 2018 Author Report Share Posted November 2, 2018 That worked! Thank you for the quick response! Quote Link to comment Share on other sites More sharing options...
acantor Posted November 2, 2018 Report Share Posted November 2, 2018 Now, whittle the delay down to discover how short is actually needed. You may find you only need a few hundred milliseconds. Quote Link to comment Share on other sites More sharing options...
rberq Posted November 2, 2018 Report Share Posted November 2, 2018 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.