dwaynek Posted November 4, 2006 Share Posted November 4, 2006 I'm writing a script to launch firefox and load a website but instead of putting in a time delay (because this can vary depending on the response from the website, the speed of the computer, what other tasks is being done etc), how do i check firefox that it has completed downloading a page before continuing the script? Link to comment Share on other sites More sharing options...
PaulIA Posted November 4, 2006 Share Posted November 4, 2006 Does FF pop up a window while it's downloading? Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
theguy0000 Posted November 5, 2006 Share Posted November 5, 2006 (edited) Does FF pop up a window while it's downloading?yes, but that window contains a list of many other downloads too.*looks at it with autoit window info*ok well you won't get any info from the controls, but I would look for this:When the title of the window changes from*% of * filetoDownloadsthat will mean that the download is complete.one sec, i'll put together some code for you. Edited November 5, 2006 by theguy0000 The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN Link to comment Share on other sites More sharing options...
GaryFrost Posted November 5, 2006 Share Posted November 5, 2006 yes, but that window contains a list of many other downloads too.*looks at it with autoit window info*ok well you won't get any info from the controls, but I would look for this:When the title of the window changes from*% of * filetoDownloadsthat will mean that the download is complete.This all assumes no other download extensions have been installed SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
theguy0000 Posted November 5, 2006 Share Posted November 5, 2006 (edited) This all assumes no other download extensions have been installedthat's true...I don't think theres any sure-fire way, since you never know what extensions the user might have. but i can still write up some code for the regular downloader I don't think I've ever used regular expressions, but would this be correct? (?i)[:digit:]*% of [:digit:]* file Edited November 5, 2006 by theguy0000 The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN Link to comment Share on other sites More sharing options...
theguy0000 Posted November 5, 2006 Share Posted November 5, 2006 yep, it worked, here ya go Opt ("WinTitleMatchMode", 4) While Not WinExists ("regexp=(?i)[1-9]*% of [1-9]* files?") Sleep (100) WEnd While WinExists ("regexp=(?i)[1-9]*% of [1-9]* files?") TrayTip ("", "downloading...", 10) Sleep (500) WEnd TrayTip ("", "", 0) Sleep (1000) If WinExists ("Downloads") Then MsgBox (0, "info", "download complete") Else MsgBox (0, "", "you can't close the window or you'll mess it up...") EndIf thats actually pretty cool The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN Link to comment Share on other sites More sharing options...
Fossil Rock Posted November 5, 2006 Share Posted November 5, 2006 Is the OP asking about downloading a file or loading the page ? If loading a page is what is being done then something like a PixelCheckSum of the animated graphic in the top right might do. Agreement is not necessary - thinking for one's self is! Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 5, 2006 Moderators Share Posted November 5, 2006 yep, it worked, here ya go Opt ("WinTitleMatchMode", 4) While Not WinExists ("regexp=(?i)[1-9]*% of [1-9]* files?") Sleep (100) WEnd While WinExists ("regexp=(?i)[1-9]*% of [1-9]* files?") TrayTip ("", "downloading...", 10) Sleep (500) WEnd TrayTip ("", "", 0) Sleep (1000) If WinExists ("Downloads") Then MsgBox (0, "info", "download complete") Else MsgBox (0, "", "you can't close the window or you'll mess it up...") EndIf thats actually pretty cool I'm so out of the loop... when the hell did regexp get added to the window MatchMode 4 option ? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
GaryFrost Posted November 5, 2006 Share Posted November 5, 2006 I'm so out of the loop... when the hell did regexp get added to the window MatchMode 4 option ?3.2.1.7 SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
theguy0000 Posted November 5, 2006 Share Posted November 5, 2006 I'm so out of the loop... when the hell did regexp get added to the window MatchMode 4 option ?lol, I just saw a post by valik on it yesterday, I never knew that either The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN 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