danmcg Posted November 19, 2020 Posted November 19, 2020 i have the following script that loads xml into an excel workbook. all is working good. but would like to expand on my script by capturing a dialog box that confirms the xml is well formed. how can that be done? #include <AutoItConstants.au3> run("C:\Program Files (x86)\Office RibbonX Editor\OfficeRibbonXEditor.exe") WinSetState("Office RibbonX Editor", "", @SW_MAXIMIZE) sleep(3000) send("^o") send("C:\Users\USERNAME\Documents\Excel\RibbonTester.xlsm") send("{ENTER}") send("^a") send("^v") MouseClick($MOUSE_CLICK_LEFT, 360, 60, 2) send("{ENTER}") send("^s") send("^w") run("C:\Program Files (x86)\Microsoft Office\root\Office16\excel.exe C:\Users\USERNAME\Documents\Excel\RibbonTester.xlsm") winclose("Office RibbonX Editor") so just after the mouse click, when i am sending the enter key, what i would like to happen is to verify that the dialog box appears. if there is an issue with the xml, then the dialog box does not appear and a panel is opened in the editor with the offending line(s) of code. all i need to do is confirm whether or not the dialog box appears. can that be done with autoit?
danmcg Posted November 19, 2020 Author Posted November 19, 2020 so i finally got control viewer to pick up the dialog box. below are the settings
Nine Posted November 19, 2020 Posted November 19, 2020 One way is to use WinWait ("[CLASS:#32770]", "", 2) with a timeout (here 2 secs). If it returns an error it means that the xml is not valid. “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
danmcg Posted November 19, 2020 Author Posted November 19, 2020 thanks nine, i will add that to the code. really appreciate the help.
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