Ysengrim Posted November 16, 2007 Posted November 16, 2007 Because I couldn't find a way to upload files to my website automaticly I changed my way of working and started to use FileZilla to do the job for me.Evrything works perfectly with using shortcuts but I found myself stuck on the final problemI want to close Filezilla automatic after uploading the fileI don't want to use the sleep() function and processclose() because the script can close Filezilla before ending the upload jobI don't can use the winwaitclose() function either because there are no pop-up windows coming upThe only thing I could think of was trying to captury the text from a window that give a logview of whats happening$text=ControlGetText ( "FileZilla version 2.2.32", "", "[CLASS:RichEdit20W; INSTANCE:1]")MsgBox(0, "the text is :", $text)the output = Status: Starting upload of C:\Program Files\Beurs\Website Offline\bestanden\Bolero.pdfCommand: TYPE IResponse: 200 Type set to ICommand: PASVResponse: 227 Entering Passive Mode (195,130,132,85,20,204).Command: STOR Bolero.pdfResponse: 150 Opening BINARY mode data connection for Bolero.pdfResponse: 226 Transfer complete.Status: Upload successfulCommand: REST 0Response: 350 Restarting at 0. Send STORE or RETRIEVE to initiate transferStatus: Disconnected from serverI have to wait for the last line : upload succesful before closing the programNow my question is1) is there an easier way to see of the upload was fininshed (because I think this is not the best way I was thinking of right now)2) how can i make the script telling me when the line "Status: Upload successful" appears in that window so I can stop the script when it returns that valuebecause the script is scrolling and making new text very quickI will thank you in front for helping me outYsengrim
Nahuel Posted November 16, 2007 Posted November 16, 2007 Well, your idea was good! Global $Finished=False While Not $Finished $OutPutText=ControlGetText ( "FileZilla version 2.2.32", "", "[CLASS:RichEdit20W; INSTANCE:1]") If StringInStr($OutPutText,"Upload successful") Then ;ProcessClose("Filezilla") MsgBox(0,"","Upload successful") Exit EndIf Sleep(100) WEnd
Ysengrim Posted November 16, 2007 Author Posted November 16, 2007 Nahuel said: Well, your idea was good! Global $Finished=False While Not $Finished $OutPutText=ControlGetText ( "FileZilla version 2.2.32", "", "[CLASS:RichEdit20W; INSTANCE:1]") If StringInStr($OutPutText,"Upload successful") Then ;ProcessClose("Filezilla") MsgBox(0,"","Upload successful") Exit EndIf Sleep(100) WEnd Nahuel THANKS !!!!!!!!!!!!!!!!!!!!!!!!! its working perfectly I still got to learn a lot and but because of the help here I'm motivated to continu learning and trying This forum is great when you stuck on a problem and losing hours of testing
kwixro Posted December 16, 2010 Posted December 16, 2010 I try with FlashFXPGlobal $Finished=False While Not $Finished WinWait("FlashFXP") If Not WinActive("FlashFXP") Then _ WinActivate("FlashFXP") WinWaitActive("FlashFXP") $OutPutText= ControlGetText ( "FlashFXP", "", "[CLASS:TWinConsole; INSTANCE:2]") If StringInStr($OutPutText,"Transfer complete") Then ProcessClose("FlashFXP") MsgBox(0,"","Transfer complete") Exit EndIfNot workPls help ?
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