SurajJadhav Posted March 9, 2021 Share Posted March 9, 2021 WinActivate("[A] Item Details - Internet Explorer") WinWaitActive("[A] Item Details - Internet Explorer") ;Option 1: focus on notification bar ;ControlFocus("[A] Item Details - Internet Explorer","","DirectUIHWND1") ; or ;Option 2: Send alt+n key to focus on navigation bar Send("!N") ;Send DOWN key to navigate to Save as option Send("{DOWN}") ;Send A to open 'Save as' dialog box Send("{a}") ;Wait for dialog window to open WinWait("Save As") $hWnd = WinGetHandle("Save As") Sleep(2000) ;Set focus on 'Save as' dialog box ControlFocus($hWnd, "", "[CLASS:Edit; INSTANCE:1]") ;Set text to TEST_FILE.html ControlSetText($hWnd, "", "[CLASS:Edit; INSTANCE:1]", "Test_File", 1) ;Sleep for 4s Sleep(4000) ControlFocus($hWnd, "", "[CLASS:ToolbarWindow32; INSTANCE:3]") ; Right click inside control to invoke "Edit Address" ControlClick($hWnd, "", "[CLASS:ToolbarWindow32; INSTANCE:3]", "right") ; Choose "Edit Address" option ControlSend($hWnd, "", "[CLASS:ToolbarWindow32; INSTANCE:3]", "e") Sleep(250) Send("{DEL}") Sleep(250) Send("autoIt\au3_files\IE" & "{ENTER}") Sleep(250) ControlClick($hWnd, "", "[CLASS:Button; TEXT:&Save;]") WinClose($hWnd) Link to comment Share on other sites More sharing options...
Nine Posted March 9, 2021 Share Posted March 9, 2021 Please use this tool when you post code. Here what I am using : Const $sFileName = "C:\Apps\Temp\Test.txt" ; full path FileDelete($sFileName) Local $hWnd= _IEPropertyGet ($oIE, "hwnd") Local $hCtrl = ControlGetHandle ($hWnd, "", "DirectUIHWND1") ConsoleWrite ("Control = " & $hCtrl & @CRLF) If Not $hCtrl Then Exit MsgBox ($MB_SYSTEMMODAL, "", "Unable to find DL control") WinActivate ($hWnd) WinWaitActive($hWnd) ControlSend ($hWnd, "", $hCtrl, "{F6}{TAB}") Sleep (800) ControlSend ($hWnd, "", $hCtrl, "{DOWN 2}{ENTER}") $hDlg = WinWait("Enregistrer sous") ConsoleWrite ($hDlg & @CRLF) Sleep(1000) $hFile = ControlGetHandle($hDlg, "", "Edit1") ConsoleWrite ($hFile & @CRLF) ControlSetText($hDlg, "", $hFile, $sFileName) ControlClick($hDlg, "", "Button1") ; wait till the DL is finished Do Sleep(100) Until FileGetSize($sFileName) Sleep (1000) ; to hide the download window WinActivate($hWnd) ControlSend($hWnd, "", $hCtrl, "{F6}") Sleep(300) ControlSend($hWnd, "", $hCtrl, "{ESC}") Sleep(1000) ;_IEQuit ($oIE) You will need to change title of the Save As Dialog Window... SurajJadhav 1 “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 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