Sign in to follow this  
Followers 0
feldmaneyal

Web sync + send email

7 posts in this topic

Hi,

1. I need to know when the web page finished downloading, how can i do it?

2. Send email when 1 is done

thx

Eyal

Share this post


Link to post
Share on other sites



1. Maybe something like this:

URLDownloadToFile ( "http://something", "filename" ) 
; Check every 2 seconds to see if file is finished downloading
$size = FileGetSize("filename") 
Sleep(2000)
While FileGetSize("filename") > $size
  Sleep(2000)
WEnd

2. Try third-party software (search for command-line email programs)


Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

I think CyberSlug's example will enter an infinite loop, try...

URLDownloadToFile ( "http://something", "filename" ) 
; Check every 2 seconds to see if file is finished downloading
$size = FileGetSize("filename") 
Sleep(2000)
While FileGetSize("filename") > $size
 $size = FileGetSize("filename") 
 Sleep(2000)
WEnd

(added the line to set $size within the while loop)


GrahamS

Share this post


Link to post
Share on other sites

:whistle: But ummm .. doesn't control pass on from URLDownloadToFile() only when it has finished?

I get $nLoops = 0 from the following modified scriptlet:

; Monitor download, to determine when it has finished
;-------------------------------------------------------

ProgressOn("Downloading", "Step1/3", "URLDownloadToFile() starting")

    URLDownloadToFile ( "http://www.snopes.com", "filename" ) 
    
ProgressSet(50, "Monitor loop starting", "Step2/3")

   ; Check every 2 seconds to see if file is finished downloading
    $nSize = FileGetSize("filename") 
    Sleep(2000)
    $nLoops = 0
    While FileGetSize("filename") > $nSize
        $nLoops = $nLoops + 1
        $nSize = FileGetSize("filename") 
       ;Sleep(2000)
    WEnd

ProgressSet(100, "$nLoops=" & $nLoops, "Step3/3")
    Sleep(5000)

Exit

.. Which means you just need:

;Download to file
    URLDownloadToFile ( "http://www.snopes.com", "filename" ) 

;Send email (cos by this point the download has completed)
   ;???? commandline utility
   ;???? commandline utility
   ;???? commandline utility
B)

Share this post


Link to post
Share on other sites

I thought the script will not continue until the URL is completely downloaded.

as far as I have done:

URLDownloadToFile ( "http://something", "filename" )
run("myemailprog.exe me@me.com done")

there are a lot of nice command line email senders.


AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites

If all you need is notification use a message box. The script will not continue untill the download completes anyway.

URLDownloadToFile("http://www.hiddensoft.com", "C:\mydownload.htm")
MsgBox (4096,'', 'DONE!!',1)

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Hi,

1. I need to know when the web page finished downloading, how can i do it?

2. Send email when 1 is done

thx

Eyal

:P i think i got wat you need...

well i have a autoit web browser i made ... and what i sue to see if a page is loaded is this

$Obj1 = ObjCreate("Shell.Explorer.2");;; creast a shell object

$Obj1_ctrl = GUICtrlCreateObj($Obj1, 8, 8, 1226, 604) ;;; create the window on the gui so you can see it

$Obj1.navigate ("http://www.dreamlords.com") ;;;;;Go to whatever site you want

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

While $Obj1.busy

Sleep (30) ; Idle around while site is loading

WEnd

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Edited by Blessedone

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0