Rishav Posted March 30, 2009 Share Posted March 30, 2009 Hi folksI have a problem. Every once in a while I get unhandled exceptions in my product. to take care of such errors during automation I want to use a winexist command. the problem is that the text for the error is not constant.So I need to add in a regular expression towards the end of the command as;Winexists("","Unhandled excpetion has occured in your application<whatever follows from here>")Another way is using the Opt("WinTitleMatchMode", 4) setting. However, I need to use the setting only for that winexist command and not for the entire script. declaring WinTitleMatchMode before winexists and the resetting it to default feels counterintuitive.any suggestions?regardsRishav Link to comment Share on other sites More sharing options...
Nahuel Posted March 30, 2009 Share Posted March 30, 2009 Well, AutoIt will match the title of the window from the beggining by default. This means that if you use:GUICreate("Unhandled excpetion has occured in your application Error:4564654") GUISetState() If Winexists("Unhandled excpetion has occured in your application") Then MsgBox(0,"","The window exists")It'll work just fine.But if you still want to use Regular Expressions, take a look at Advanced Window Descriptions in the help file. Here's an example:GUICreate("Unhandled excpetion has occured in your application Error:4564654") GUISetState() If Winexists("[REGEXPTITLE:Unhandled excpetion has occured in your application(.*?)]") Then MsgBox(0,"","The window exists")^This isn't really a good example on regular expressions, but you get the point. Link to comment Share on other sites More sharing options...
Rishav Posted March 30, 2009 Author Share Posted March 30, 2009 Well, AutoIt will match the title of the window from the beggining by default.That was mean. o.0now I'll go and sob in a corner for asking such a retarded question. ps. Thank you. Link to comment Share on other sites More sharing options...
PsaltyDS Posted March 30, 2009 Share Posted March 30, 2009 That was mean. o.0now I'll go and sob in a corner for asking such a retarded question. ps. Thank you.It gets worse. Setting WinTitleMatchMode = 4 is a legacy behavior, and those advanced strings work by default in the current version.On the positive side, you have a loooooong way to go before you ask as many retarded questions as I have! Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now