Need a way to recognize a cursor change while moving mouse.

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Jim Raynor
Newbie
Posts: 1
Joined: Thu Nov 02, 2006 5:32 pm

Need a way to recognize a cursor change while moving mouse.

Post by Jim Raynor » Thu Nov 02, 2006 5:40 pm

Is there a way to recognize a cursor change (the cursor changes from one graphic to another) while moving the mouse across the screen with MouseMove commands?

I need to know when the mouse is over a graphical button that does not always have the same visual appearance. Since the cursor changes when it is over the button, monitoring the cursor would seem like an ideal way to solve the problem.

Any ideas would be apprecaited.

Thank you.


P.S. Even a way to inspect the cursor color would be immensely useful.

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Thu Nov 02, 2006 6:07 pm

Put this script into a separate .scp file either dynamically by writing it from your original script or just create the file.

Code: Select all

Label>Waiting
WaitCursorChanged>0.1
If>WCC_RESULT=FALSE,Waiting
//do something or do something that can be detected 
//by your original script such as create a file



Then call it from your script using the command line:

Code: Select all

Run>[Path]\msched.exe script.scp
Using Run>msched.exe rather than using the Macro> function will allow the called script to run concurrently with your calling script. The Macro> function is modal, meaning that when it is called the calling script ceases processing until the called script completes. To make the process outlined here work, both scripts need to run at the same time.

If you could use the Macro> function you could pass information from the called script to the calling script by using the MACRO_RESULT variable. In this case, because you cannot use the Macro> function, your original script will need to look for a file to exist or perhaps specific text in the clipboard or... and based on that info, perform an action.

Hopefully you get the idea.

Depending upon how quickly your cursor is moving around on the screen, you may need to adjust the WaitCursorChanged timout.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts