Khoneini Posted March 28, 2013 Share Posted March 28, 2013 All, I'm having issues with programming a additional script in AutoIT. The problem is that sometimes a Window pops up and I want the script to automaticlly click NO when the Window occurs. The only problem is that I can't filter on Window name. This because the window name of the popup box is the same as the Window name of the main application. Please see the Control dialog of this button below: expandcollapse popup>>>> Window <<<< Title: Microsoft Dynamics GP Class: TNTDLG Position: 230, 199 Size: 486, 197 Style: 0x94C00000 ExStyle: 0x00000101 Handle: 0x067B0620 >>>> Control <<<< Class: Button Instance: 2 ClassnameNN: Button2 Name: Advanced (Class): [CLASS:Button; INSTANCE:2] ID: 2 Text: &No Position: 260, 132 Size: 80, 24 ControlClick Coords: 49, 12 Style: 0x5000030B ExStyle: 0x00000000 Handle: 0x040405D0 >>>> Mouse <<<< Position: 542, 365 Cursor ID: 0 Color: 0xE7E7EF >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< &Yes &No >>>> Hidden Text <<<< Any idea how I can build a check based on above Control information? Any help or directions are greatly appreciated. Link to comment Share on other sites More sharing options...
water Posted March 28, 2013 Share Posted March 28, 2013 Please have a look at the help file, function WinWait. There are many ways to specify which window you want to wait for. In your case I suggest to use the Class. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Khoneini Posted March 28, 2013 Author Share Posted March 28, 2013 (edited) So, something like this? I want a 10 minute loop from 23:55 till 00:05 to check for this window(it occurs between that time): $iBegin = TimerInit() ;GET A TIMESTAMP FOR THE LOOP Do ;START THE LOOP If WinExists("[TITLE:Microsoft Dynamics GP; CLASS:TNTDLG]") Then ;LOOK FOR THE DIALOG WinActivate("[TITLE:Microsoft Dynamics GP; CLASS:TNTDLG]") ;ACTIVATE REPORT DESTINATION WINDOW ControlClick("[TITLE:Microsoft Dynamics GP; CLASS:TNTDLG]", "", "Button2") ;CLICK "CANCEL" Button $iBegin = TimerInit() ;RESET THE TIMESTAMP SO IT WILL START THE LOOP AGAIN EndIf Sleep(10) ;GIVE THE CPU A BREATHER Until TimerDiff($iBegin) > 600 * 1000 ; EXIT THE LOOP IF WE GO 600 SECS(10 MINUTES) WITHOUT CANCELLING A DIALOG Credits go to Melba23 for above script in my previous topic but I think it might be a solution for this too. Can someone please verify? Edited March 28, 2013 by Khoneini Link to comment Share on other sites More sharing options...
water Posted March 28, 2013 Share Posted March 28, 2013 Looks good so far. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
RogerH Posted June 20, 2013 Share Posted June 20, 2013 Did you have any luck with this? I have a very similar problem on automating the client installer to dismiss the "You do not have permission to open this file" dialog box. Link to comment Share on other sites More sharing options...
water Posted June 20, 2013 Share Posted June 20, 2013 Doesn't the client installer have command line switches so you can do a silent isntall? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki 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