Eg6Xpm18cs Posted February 15, 2011 Report Share Posted February 15, 2011 Hi all, Is there a way to get control of a feature that can have a different (unpredictable) name each time it is accessed? The name I'm referring to is the "Window Text" in the Get Control Utility tool. Any help appreciated. Quote Link to comment Share on other sites More sharing options...
acantor Posted February 16, 2011 Report Share Posted February 16, 2011 Is there anything in common between the names of the controls? For example, do they always contain "ABC 123"? If yes, I think it is possible to extract the text of the control into a text variable, and then test it to see whether that variable contains the string that is common to all of your target controls. Quote Link to comment Share on other sites More sharing options...
Eg6Xpm18cs Posted February 20, 2011 Author Report Share Posted February 20, 2011 Is there anything in common between the names of the controls? Unfortunately, no, the names/text can vary all over the map. Otherwise I'll resort to tabbing, Alt-shortcuts or mouse moves/click, but I like to use controls when available, as they're solid and give me more confidence in the macro. Quote Link to comment Share on other sites More sharing options...
kevin Posted February 21, 2011 Report Share Posted February 21, 2011 If you know or can determine the position of the control(s) you could use the Capture Control command. Quote Link to comment Share on other sites More sharing options...
Eg6Xpm18cs Posted February 27, 2011 Author Report Share Posted February 27, 2011 If you know or can determine the position of the control(s) you could use the Capture Control command. Thank you. I often overlook Capture Control because I got in the habit of using the other methods before learning what Capture did. Quote Link to comment Share on other sites More sharing options...
Eg6Xpm18cs Posted March 1, 2011 Author Report Share Posted March 1, 2011 Is there anything in common between the names of the controls? For example, do they always contain "ABC 123"? If yes, I think it is possible to extract the text of the control into a text variable, and then test it to see whether that variable contains the string that is common to all of your target controls. Now I do have a situation where a control has varying Window Text with a common term in all situations, but I'm not seeing how to extract the text. At first I thought Get Control might allow a partial-text target (the common text), but that's not the case. Appreciate any suggestions. Quote Link to comment Share on other sites More sharing options...
paul Posted March 2, 2011 Report Share Posted March 2, 2011 AutoIt allows you to identify controls by a number of different criteria, i.e. ID, Text, Class, position and size, instance. Having identified a control, you can then retrieve, and also set, its text. Since AutoIt interfaces directly with MEP, you might want to take a look. AutoIt 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.