Jump to content
Macro Express Forums

Can't Find Control


KFOR777

Recommended Posts

OK, I'm perplexed. <_<

I have a macro clicking on a control object.

Everything works great until the next day when I try to run the macro again and tells me it can't find the control.

I'm still testing this to see if this happens all the time or sporadically.

So far I have not been able to recreate the issue by just recycling the program or recycling macro express.

Do you know of any issues regarding losing controls?

Link to comment
Share on other sites

We have noticed that some programs create a new version of the control each time they run. It is not inconceivable that other programs create new versions of the control on different days.

 

When you add a 'Get Control' command to your macro and use the Get Control Utilitiy, there are two flavors of controls that are returned. If you have tried to Get the Control with the 'Get Control Using Text' option unchecked, then check it and see if that helps (and visa versa).

 

Some of the macros I have written require the 'Get Control Using Text' option to be checked while others require it to be unchecked.

 

If that doesn't work then you may need to use the 'Capture Control' command to obtain the Window Control information when the macro runs instead of when you are writing it. This, however, requires that you know the position of the control.

Link to comment
Share on other sites

It appears that the Specific Coordinates for the Capture Command are for the Screen not the Window. That's not going to work because the program is never maximized and can be anywhere on the screen. Some people have dual monitors and position the program in a certain spot.

Are there any plans to add an option for specific coordinates for the window vs. screen?

 

Thanks! :)

Link to comment
Share on other sites

Are there any plans to add an option for specific coordinates for the window vs. screen?
No. If I remember correctly, there are technical reasons that prevent referencing a control relative to a window. However, I can think of two possible work arounds:

 

1. If there is a Window Control that represents the entire window, you may be able to use the Get Control command for it and use that control to calculate the position of the control within the window. This will only work if, unlike the other Window Control you are working with, the Window Control of the main window remains consistent.

 

2. Or you could try something like this:

- Save the size and position of the window you are working with.

- Set the window to a specific size and position.

- Capture the Control.

- Restore the original size and position of the window.

 

Yes, this would cause the window to move as the control was captured. But, if you use the Variable Save and Restore technique, you may only have to do this once.

Edited by kevin
Link to comment
Share on other sites

  • 3 weeks later...

Join the conversation

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

Guest
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.

Loading...
×
×
  • Create New...