johnmcloud Posted September 27, 2012 Share Posted September 27, 2012 (edited) Hi guys, i need an help for a script. The situation is: I have a txt file with some command for a FTP site. I can download only ONE file at the time with a particular software for the company where I work, so i need to copy-paste the link on the software, wait for the download, than copy paste the second link ect.. The folder of download is the same for every file. The procedure is: 1) Take the first line of the txt, copy-paste on the software ( LINK1) 2) Wait for the download is finished ( i have think to use FileExist, but i don't know the name of the file. I can't use IE or internal autoit function for download the file ) 3) Take the second line of the txt, copy-paste on the software ( LINK2 ) 4) Wait for the download is finished ( so i have 2 file in the same folder ) 5) Take the third line of the txt, copy-paste on the software ( LINK3 ) 6) etc... The txt is: LINK1 LINK2 LINK3 etc... For read the line i have think to use FileOpen/FileReadLine or _FileReadToArray, but the problem is how to understand when a file ends/download is finished, and then copy the second line in the software Thanks for any help Edited September 27, 2012 by johnmcloud Link to comment Share on other sites More sharing options...
FireFox Posted September 27, 2012 Share Posted September 27, 2012 file ends/download is finished, and then copy the second line in the software huh, you have to find a way to check when a download is finished. You can try to read the controls of the software (autoit3info will help you), but I don't think this will work. Second option I'm thinking about, check if the file [being] downloaded is already opened (means that it's not finished). You can list all the files in the download directory at run time then each time there is a new file, then it's the file being downloaded. Br, FireFox. Link to comment Share on other sites More sharing options...
johnmcloud Posted September 27, 2012 Author Share Posted September 27, 2012 You can try to read the controls of the software (autoit3info will help you), but I don't think this will work. Not work, no way to use autoit3info on that software Second option I'm thinking about, check if the file [being] downloaded is already opened (means that it's not finished). You can list all the files in the download directory at run time then each time there is a new file, then it's the file being downloaded. Br, FireFox. I thought about using DirGetSize for check it out the number of the file but the file is created at the startup of the download, so a file exist also if it's not finished. Link to comment Share on other sites More sharing options...
hannes08 Posted September 27, 2012 Share Posted September 27, 2012 You could get a list of files in the download directory via _FileListToArray() twice, once before you start the download and again after a few seconds. Compare the two lists for changed files and use a method similar to what FireFox has suggested to check whether the file is available. Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler] Link to comment Share on other sites More sharing options...
FireFox Posted September 27, 2012 Share Posted September 27, 2012 I thought about using DirGetSize for check it out the number of the file but the file is created at the startup of the download, so a file exist also if it's not finished.That's why I said you need to check if the file is opened. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 27, 2012 Moderators Share Posted September 27, 2012 johnmcloud, Take a look at seangriffin's FielSystemMonitor UDF. I have used to to identify file copy completion so you should be able to identify download completion as well. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
johnmcloud Posted September 27, 2012 Author Share Posted September 27, 2012 (edited) Hi Melba, can you show me a little example usign that UDF? You can use at the top of the script: $my_url = "http://www.autoitscript.com/cgi-bin/getfile.pl?autoit3/autoit-v3-setup.exe" ShellExecute("iexplore.exe", $my_url) ; Save the file in @WorkingDir & "Test" or anything you want For check it out if work also on download Thanks Edited September 27, 2012 by johnmcloud 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