Jump to content
Macro Express Forums

Determining Focus, Couple Questions


Recommended Posts

to all,

I read through the forum last evening, and now understand about pixel/color, but that won't totally address what I want to do.


I'm trying to determine several items in my macro; the status of these then determine the next step.

CURRENTLY, I just use delays of about 500 to 1500 milliseconds, but if I can address teh following, then I can make this go much faster (about 15 delays in the macro)



I I have a scanning program. It lists file/document names. The documents are named by text on screen, BUT the text is not retrievable by cut/copy/paste methods; it is just on screen.


The CURRENT document is white text on blue background, and it exists at a certain position on the list of names.

If I RENAME it, it re-sorts to a different position, but retains the blue focus


IS there a way to

1. EXTRACT THE TEXT beneath the highlighted/blue area, to convert to usable text?

2. determine the FOCUS LOCATION (relative to screen ) of the highlighted name? (the file name, when re-sorted, moved; I want the system to tell me the new location automatically)




ALSO, is there a way to determine, from a CURRENT mouse cursor location, whether the mouse cursor is an ARROW (awaiting action) or an hourglass (doing something) or some utility which will tell me what is currently active; ? I want to be able to determine when current item finishes (mouse reverts to arrow) so I can proceed to next step


Any help appreciated




Link to comment
Share on other sites

#1) It could probably be accomplished with an external software package that does screen text capturing. SnagIt from Techsmith comes to mind, but there are others. You can use Macro Express to control the automation of it same as any other software.


#2) Not sure.


#3) There are mouse commands in Macro Express for handling this:


Wait for Mouse Cursor

Wait for Not Mouse Cursor

If Mouse Cursor

If Not Mouse Cursor

Link to comment
Share on other sites


thanks for reply


re: the mouse controls -

how do you determine the actual state of the mouse or the cursor? example, if I start an activity, mouse cursor turns to hourglass, but sometimes reverts to the left arrow again, then back to the hourglass.


then it finally stabilizes as the left arrow.


How to determine if it is in a final "left arrow" state?




Link to comment
Share on other sites

The trick is to write a routine that makes sure that the mouse cursor has been an arrow for a minimum amount of time. This sample macro will make sure that the mouse cursor has been an arrow for at least 2 seconds. It checks every tenth of a second.

Variable Set Decimal %D1% to 0.0

Repeat Until %D1% >= 2.0
 Delay 0.1 Seconds
 If Mouse Cursor is Arrow
   Variable Modify Decimal: %D1% = %D1% + 0.1
   Variable Set Decimal %D1% to 0.0
 End If
Repeat End

Depending on your application, you may want to adjust the timing.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...