codalith Posted October 29, 2010 Share Posted October 29, 2010 Newbie alert! Still coming up to speed and trying to learn why things are the way they are... ;some set up code here gets us to the File Download Dialog ... ;File Download Dialog WinWaitActive("File Download") ; Attempt 1 ;Send("!S") - doesn't work ; Attempt 2 ;Send("+{TAB}") ; Shift+TAB, Move Focus left to Save ;Send("{ENTER}") ; Nope, this also doesn't work. ; Attempt 3 MouseMove(X, Y, 20) ; for suitable values of X and Y MouseClick("left") ; Finally! This works ;"Save As" Dialog WinWaitActive("Save As", "&Save") Send("!S") ; no problem to use !S here ;"Confirm Save As" Dialog WinWaitActive("Confirm Save As", "&Yes") Send("!Y") ;"Download complete" Dialog WinWaitActive("Download complete", "Close") Send("{ENTER}") ; ------------------------------- I would prefer to use Send("!s") instead of a mouseclick to make the script independent of the X,Y co-ords, but, for the File Download dialog, these just don't work for the Save button. AutoIt is great. It makes a lot of things simple that other tools make a meal out of, so I don't mind paying my dues, I already know the payback is worth it. So, where's the smart place to go to find more of these quirks? As great as this forum is, if there is anything on this topic it's buried in noise. Link to comment Share on other sites More sharing options...
Shimgreen Posted October 31, 2010 Share Posted October 31, 2010 You can use the InetGet or the InetRead function in .au3 to download files from websites, and save it to your hard drive, eliminating the need to open up and automate a web browser to download a file. Link to comment Share on other sites More sharing options...
codalith Posted October 31, 2010 Author Share Posted October 31, 2010 (edited) >You can use the InetGet or the InetRead function in .au3 to download files from websites, and save it to your hard drive, eliminating the need to open up and automate a web browser to download a file. How do you use these when the site login sets http cookies? (edit to fix lousy formatting) Edited October 31, 2010 by codalith Link to comment Share on other sites More sharing options...
Tvern Posted October 31, 2010 Share Posted October 31, 2010 One way is use an embedded IE control. This works well if you want to use IE in the background anyways. I think it works because AutoIt becomes the parent process for IE, and as such id seen as logged in. Another way is to drop IE and use the WinHttp UDF by trancexx. It's faster, uses less bandwidth amd cpu, but because it has no graphical interface of it's own it can be a bit harder to create the script. There may be other ways. Link to comment Share on other sites More sharing options...
Alma Posted December 8, 2010 Share Posted December 8, 2010 Newbie alert! Still coming up to speed and trying to learn why things are the way they are... ;some set up code here gets us to the File Download Dialog ... ;File Download Dialog WinWaitActive("File Download") ; Attempt 1 ;Send("!S") - doesn't work ; Attempt 2 ;Send("+{TAB}") ; Shift+TAB, Move Focus left to Save ;Send("{ENTER}") ; Nope, this also doesn't work. ; Attempt 3 MouseMove(X, Y, 20) ; for suitable values of X and Y MouseClick("left") ; Finally! This works ;"Save As" Dialog WinWaitActive("Save As", "&Save") Send("!S") ; no problem to use !S here ;"Confirm Save As" Dialog WinWaitActive("Confirm Save As", "&Yes") Send("!Y") ;"Download complete" Dialog WinWaitActive("Download complete", "Close") Send("{ENTER}") ; ------------------------------- I would prefer to use Send("!s") instead of a mouseclick to make the script independent of the X,Y co-ords, but, for the File Download dialog, these just don't work for the Save button. AutoIt is great. It makes a lot of things simple that other tools make a meal out of, so I don't mind paying my dues, I already know the payback is worth it. So, where's the smart place to go to find more of these quirks? As great as this forum is, if there is anything on this topic it's buried in noise. Hi, Did you solve this problem? I am having the same problems with my script... Thanks, Alma Link to comment Share on other sites More sharing options...
arpan Posted April 27, 2011 Share Posted April 27, 2011 Hi, Did you solve this problem? I am having the same problems with my script... Thanks, Alma may be you can try this: while (True) WinWaitActive("File Download") Sleep(1000) WinWaitActive("Save As") Send("{Enter}") Sleep(500) Send("!y") WinWaitActive("Download complete", "Close") WinActivate( Send("{ENTER}") WEnd 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