TracyC Posted February 24, 2021 Share Posted February 24, 2021 Hello! I found this piece of code on the forum, and it supposedly worked to bypass that pesky download window in IE. Basically I want to mimic the "alaways download the file" option that IE took away from us. Currently, when I download a Word file on IE, I get a popup box where I am forced to click 'Open." var winHandle = AutoItX.WinGetHandle("[Class:IEFrame]"); var ctrlHandle = AutoItX.ControlGetHandle(winHandle, "[Class:DirectUIHWND]"); var ctrlPos = AutoItX.ControlGetPos(winHandle, ctrlHandle); AutoItX.WinActivate(winHandle); AutoItX.ControlClick(winHandle, ctrlHandle, "primary", 1, ctrlPos.Width - 160, ctrlPos.Height - 30); Thread.Sleep(1000); AutoItX.ControlSend(winHandle, ctrlHandle, "{ENTER}"); I am getting an error when I run it that says: Varwinhadle=AtoITX.wingethandle["[Class:IEFrame]"] ^ ERROR Can anyone help me fix it? Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted February 25, 2021 Moderators Share Posted February 25, 2021 (edited) Moved to the appropriate forum, as the Developer General Discussion forum very clearly states: Quote General development and scripting discussions. Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums. Moderation Team Edited February 25, 2021 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Nine Posted February 25, 2021 Share Posted February 25, 2021 There are multiples issues in the code you provided. Please refer to AutoItX.chm help file located in AutoItX folder. As described in help file, you cannot use handles in Win* methods nor in Control* methods. You can use Text special definition though. Third parameter of Control* methods has also some limitations. Be careful to check what they are. “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