Sly01 Posted December 5, 2023 Posted December 5, 2023 Hi Everyone, I'm trying to interact with those if they pop. (They should not pop because of the way we use our systems, but it looks like some time it may appear) When I use AutoIT Window Info it just gives me some GUI Class which I cannot trigger because it's too generic. How can I cancel that window? or make it not save?
Moderators Melba23 Posted December 5, 2023 Moderators Posted December 5, 2023 Moved to the appropriate forum. Moderation Team Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Nine Posted December 5, 2023 Posted December 5, 2023 You could get the right Excel window with something like this : HotKeySet("^!{END}", Terminate) ; ctrl-alt-end Local $hWnd While Sleep(10) $hWnd = WinGetHandle("[TITLE:Microsoft Excel; CLASS:#32770]", "Want to save your changes to") If $hWnd Then ConsoleWrite($hWnd & @CRLF) ControlClick($hWnd, "", "Button2") EndIf WEnd Func Terminate() Exit EndFunc ps. tested on my french machine and working flawlessly with french text “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy
Sly01 Posted January 9 Author Posted January 9 On 12/5/2023 at 2:33 PM, Nine said: You could get the right Excel window with something like this : HotKeySet("^!{END}", Terminate) ; ctrl-alt-end Local $hWnd While Sleep(10) $hWnd = WinGetHandle("[TITLE:Microsoft Excel; CLASS:#32770]", "Want to save your changes to") If $hWnd Then ConsoleWrite($hWnd & @CRLF) ControlClick($hWnd, "", "Button2") EndIf WEnd Func Terminate() Exit EndFunc ps. tested on my french machine and working flawlessly with french text Hi Merci But how could you find the CLASS:#32770 When I use AutoIT Window Info I get NOTHING
Nine Posted January 9 Posted January 9 You must have misused Au3info tool cause it does work for me “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy
water Posted January 9 Posted January 9 @Sly01 Please do not quote the post you reply to. We know what we have written. Simply scroll down to the end of the thread and add the new post in the edit field My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Sly01 Posted January 10 Author Posted January 10 (edited) @Nine Misuse Au3Info... Seriously? How could you misuse it... Click and point hahaha ;o) What version of Office are you using? The save window give me no details at all, No Classe no nothing no text I've used it for all my other error messages I take care of, I wouldn't see what I am doing different there... Unless there is another trick the point and click that I've never used Edited January 10 by Sly01
Nine Posted January 10 Posted January 10 maybe the freeze option bluffed you. ps. it's an old version of Office (2012) “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy
Sly01 Posted January 10 Author Posted January 10 31 minutes ago, Nine said: maybe the freeze option bluffed you. ps. it's an old version of Office (2012) Yes exactly what I thought ... Windows 2016 and Office 365 don't have the same details... It's really weird
Sly01 Posted January 10 Author Posted January 10 expandcollapse popup>>>> Window <<<< Title: Microsoft Word Class: NUIDialog Position: 657, 444 Size: 366, 122 Style: 0x94C80000 ExStyle: 0x00000101 Handle: 0x00000000001F044A >>>> Control <<<< Class: NetUIHWND Instance: 1 ClassnameNN: NetUIHWND1 Name: Advanced (Class): [CLASS:NetUIHWND; INSTANCE:1] ID: Text: Position: 0, 0 Size: 350, 83 ControlClick Coords: 159, 15 Style: 0x56000000 ExStyle: 0x00000000 Handle: 0x00000000000D045E >>>> Mouse <<<< Position: 824, 490 Cursor ID: 0 Color: 0xF0F0F0 >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< >>>> Hidden Text <<<< Here you can see attached, that's the only thing I am able to pick
Nine Posted January 10 Posted January 10 Seems that classnn has changed. Try with this new name. Remove text. Show me what you have tried that is not working... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy
water Posted January 10 Posted January 10 Another approach is to use "Events". A function gets called when a specific event (like saving or closing a document) is raised. You can then cancel the event or save the document. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Sly01 Posted January 11 Author Posted January 11 13 hours ago, Nine said: Seems that classnn has changed. Try with this new name. Remove text. Show me what you have tried that is not working... I tried to WinActivate using the classes, but it doesn't seem to work WinActivate("[CLASS:NetUIHWND]") and WinActivate("[CLASS:NUIDialog]") and WinActivate("Microsoft Word", "[CLASS:NUIDialog]") Nothing seem to activate it. Other than that, I have no idea what I can try... Beyond my small knowledge 10 hours ago, water said: Another approach is to use "Events". A function gets called when a specific event (like saving or closing a document) is raised. You can then cancel the event or save the document. What do you mean by Events? Sorry I never worked with those as of yet... But bear in mind that this is an automation computer, there is no real interaction with humans. This SAVE is actually a problem it should not happen. This is a Document that is being printed through Microsoft Word through command line, and probably the document is malformed, when the print is over and Microsoft word is trying to exit it detects it "fixed" something in it, then ask to save the changes.
Solution Sly01 Posted January 11 Author Solution Posted January 11 Thanks for your help, here is how I found how to do it. Opt("WinTitleMatchMode", 4) $WindowHandle = WinGetHandle("[TITLE:Microsoft Excel; CLASS:NUIDialog]","") WinActivate("$WindowHandle") Sleep(1000) Send("n") Excel was a bit more tricky, because in the case I have... Application Sending Print Job to Excel > Excel Opening for Printing > Send Print Job > At whatever point the file was modified and when Excel is trying to close after the print, detects the changes ask to save But the Save Dialog is not popping up automatically, you have to "Click" on excel wait for a few seconds and THENNNNN only the Save Dialog appears. So I had to add change it a little bit for Excel: Opt("WinTitleMatchMode", 2) WinActivate("Excel") Sleep(5000) Before doing my check for windows or errors, I made sure to Activate Excel with whatever windows there is wait 5 seconds to give it time to show, and then I let my script running
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