KFOR777 Posted September 20, 2005 Report Share Posted September 20, 2005 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? Quote Link to comment Share on other sites More sharing options...
kevin Posted September 20, 2005 Report Share Posted September 20, 2005 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. Quote Link to comment Share on other sites More sharing options...
KFOR777 Posted September 21, 2005 Author Report Share Posted September 21, 2005 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! Quote Link to comment Share on other sites More sharing options...
kevin Posted September 21, 2005 Report Share Posted September 21, 2005 (edited) 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 September 21, 2005 by kevin Quote Link to comment Share on other sites More sharing options...
TwoWheels Posted October 7, 2005 Report Share Posted October 7, 2005 KFOR777, Here's a workaround for the lack of Window-relative coordinates. Use the "Mouse Move Window" command, passing it the Window-relative coords of your control. Then issue the "Capture Control" command, using its "Beneath Mouse" option. I found this works fine. 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.