Akshay07 Posted November 18, 2009 Share Posted November 18, 2009 (edited) Hello, I am trying to achieve the following: 1/ Open a web page in IE and download a file from this web page 2/ Monitor when the user click on the CANCEL button while download is ongoing ---> this is where I am having issues, I can't find how to do that. Here is part of the script I am using for this: $oLinks = _IELinkGetCollection($oIE) For $oLink in $oLinks $sLinkText = _IEPropertyGet($oLink, "innerText") If StringInStr($sLinkText, $sMyString) Then _IEAction($oLink, "click") WinWaitActive ( "File Download" ) Send ("{LEFT}") ; This is to simulate a click Send("{ENTER}") ; on the "save" button (there might be a better way to do this) ; Here, I would like to monitor if ; the user click on the "cancel" button ExitLoop EndIf Next Does anyone have any hint? Edited November 18, 2009 by Akshay07 Link to comment Share on other sites More sharing options...
Valuater Posted November 18, 2009 Share Posted November 18, 2009 Can't you use InetGet() for the actual download? It would save a lot of faulty scripting. 8) Link to comment Share on other sites More sharing options...
Akshay07 Posted November 18, 2009 Author Share Posted November 18, 2009 (edited) Can't you use InetGet() for the actual download?It would save a lot of faulty scripting.8)I did not know this command and it is indeed saving a lot of instructions. I am very new to AutoIt and I am using the help as much as I can but nothing can replace experience (and learning by comments such as yours, thanks for the tip )However, I do need the user to cancel the download at any time he wants (this is mandatory), which can be achieved through "my" previous code (very much inspired from an example from the "help").Is there a way to do the same while using InetGet()? For example, by creating a window with a cancel button? I do need to have the user being able to cancel the download manually at any time, and InetGet()does not show the download progress windows. Edited November 18, 2009 by Akshay07 Link to comment Share on other sites More sharing options...
Akshay07 Posted November 18, 2009 Author Share Posted November 18, 2009 I think I found it using the Help! InetGet("abort") Thanks Valuater for telling me about InetGet() function! 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