ibanez270dx Posted June 26, 2009 Share Posted June 26, 2009 Hello, I've got an interesting problem that I think might be solvable using AutoIT, although I've never used it before... I'm running a Ruby on Rails on Windows Server 2003 (using Apache though, not IIS) and I have an app that does a test to see if the user provided MAPI credentials are valid in MS Exchange. If the credentials are good, it works fine. However, if I put false credentials, then a confirmation window pops up on the server. This makes my app hang and wait for the popup to close (which to the best of my knowledge must be done manually). Since the app will be accessed from computers other than the server, the user wouldn't know that there is a popup making the app hang. I need to somehow find a workaround for this... if this sounds like something autoIT can solve, please let me know how I might be able to resolve this. Any and all help is appreciated!! Here is the popup: "The profile name is not valid. Enter a valid profile name." [ OK | Cancel ] and apparently I need to click Cancel three times in order for it to close... This is what the window inspector thing said: >>>> Window <<<< Title: Microsoft Outlook Class: #32770 Position: 536, 405 Size: 342, 119 Style: 0x94C803C5 ExStyle: 0x00010101 Handle: 0x000B02B2 >>>> Control <<<< Class: Static Instance: 2 ClassnameNN: Static2 Advanced (Class): [CLASS:Static; INSTANCE:2] ID: 65535 Text: The profile name is not valid. Enter a valid profile name. Position: 62, 20 Size: 269, 15 ControlClick Coords: 115, 12 Style: 0x50022080 ExStyle: 0x00000004 Handle: 0x000902C0 >>>> Mouse <<<< Position: 716, 459 Cursor ID: 2 Color: 0xD6D3CE >>>> StatusBar <<<< >>>> Visible Text <<<< OK Cancel The profile name is not valid. Enter a valid profile name. >>>> Hidden Text <<<< Any and all help is appreciated!! Thanks, - Jeff Miller Link to comment Share on other sites More sharing options...
colafrysen Posted June 26, 2009 Share Posted June 26, 2009 (edited) I am sure it could be solved with AutoItJust make a script checking for the existence of the popup.If it is found, then click cancel 3 times.If you are familliar with scripting ThenHave a look at these commands:WinWaitActive ( "title" [, "text" [, timeout]] ) Or WinExists ( "title" [, "text"] )ControlClick ( "title", "text", controlID [, button [, clicks [, x [, y ]]]] ) or the more primitive way:Send ( "keys" [, flag] )Elsehttp://www.autoitscript.com/forum/index.php?showtopic=21048 Or any other tutorialEndIfGoodluck Edited June 26, 2009 by colafrysen [font="Impact"]Use the helpfile, It´s one of the best exlusive features of Autoit.[/font]http://support.microsoft.com/kb/q555375ALIBI Run - a replacement for the windows run promptPC Controller - an application for controlling other PCs[size="1"]Science flies us to the moon. Religion flies us into buildings.[/size][size="1"]http://bit.ly/cAMPZV[/size] Link to comment Share on other sites More sharing options...
colafrysen Posted June 26, 2009 Share Posted June 26, 2009 A little start (Not tested and will have to be adjusted to your needs) And... Why click 3 times? While 1 If WinExists(Title of msgbox,"The profile name is not valid. Enter a valid profile name.") Then Sleep(100) ControlClick(Title of msgbox,"The profile name is not valid. Enter a valid profile name.",CancelButtonID) Sleep(100) ControlClick(Title of msgbox,"The profile name is not valid. Enter a valid profile name.",CancelButtonID) Sleep(100) ControlClick(Title of msgbox,"The profile name is not valid. Enter a valid profile name.",CancelButtonID) Sleep(500) WEnd The drawbacks is that it will consume a tiny bit of CPU and memory as it have to be running all the time. Well, hope this helps [font="Impact"]Use the helpfile, It´s one of the best exlusive features of Autoit.[/font]http://support.microsoft.com/kb/q555375ALIBI Run - a replacement for the windows run promptPC Controller - an application for controlling other PCs[size="1"]Science flies us to the moon. Religion flies us into buildings.[/size][size="1"]http://bit.ly/cAMPZV[/size] Link to comment Share on other sites More sharing options...
ibanez270dx Posted June 26, 2009 Author Share Posted June 26, 2009 sweet! that works perfectly! Thanks for you help, I was banging my head against the walls for hours with this one!! 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