alfa Posted May 12, 2011 Share Posted May 12, 2011 How can i make autoit to finish the download of a file in IE ? I am trying to DL an excel file , wait for it to finish and than run excel. Thanks in advance. Link to comment Share on other sites More sharing options...
Lemmens Peter Posted May 12, 2011 Share Posted May 12, 2011 You could take a look at the following snippet : ... $Total_Size = InetGetSize($File_To_Download) InetGet($File_To_Download, $File_To_Save, 1, 1) While @InetGetActive sleep(250) $Mes_3 = "Downloading " & $File_name & " " & int((@InetGetBytesRead / $Total_Size) * 100) & " % completed..." TrayTip("Downloading ", $Mes_3, 10, 16) Wend ... Link to comment Share on other sites More sharing options...
guinness Posted May 12, 2011 Share Posted May 12, 2011 (edited) Look at Edited May 12, 2011 by guinness UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
UEZ Posted May 12, 2011 Share Posted May 12, 2011 (edited) You may have a look to the downloader I wrote <Tiny URL Downloader> where you can see how to wait for the download and one method to interupt it.The GDI+ stuff is just for fun only. Br,UEZ Edited May 12, 2011 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
guinness Posted May 12, 2011 Share Posted May 12, 2011 That bubble background is awesome! UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
alfa Posted May 13, 2011 Author Share Posted May 13, 2011 You could take a look at the following snippet : ... $Total_Size = InetGetSize($File_To_Download) InetGet($File_To_Download, $File_To_Save, 1, 1) While @InetGetActive sleep(250) $Mes_3 = "Downloading " & $File_name & " " & int((@InetGetBytesRead / $Total_Size) * 100) & " % completed..." TrayTip("Downloading ", $Mes_3, 10, 16) Wend ... Unfortunally it seems this is too much for me Thx for the answers though. Link to comment Share on other sites More sharing options...
jvanegmond Posted May 13, 2011 Share Posted May 13, 2011 InetGet waits for the download to finish by default. To run the file then you can use ShellExecute (assuming you download .xls or similar file).InetGet("http://example.com/thefile.xls", "thefile.xls") ; This downloads and waits for the download to finish ShellExecute("thefile.xls") ; this starts the just downloaded file, by finding the correct application (Excel) github.com/jvanegmond Link to comment Share on other sites More sharing options...
hannes08 Posted May 13, 2011 Share Posted May 13, 2011 InetGet waits for the download to finish by default. To run the file then you can use ShellExecute (assuming you download .xls or similar file). InetGet("http://example.com/thefile.xls", "thefile.xls") ; This downloads and waits for the download to finish ShellExecute("thefile.xls") ; this starts the just downloaded file, by finding the correct application (Excel) Well, just as you said. Keep it Simple. Anyway my appreciation for the other commenters for their work! Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler] Link to comment Share on other sites More sharing options...
alfa Posted May 13, 2011 Author Share Posted May 13, 2011 The file i am trying to wait it for DL doesnt have a constant name. It changes everytime i make the report and DL it. Thx a lot again. Link to comment Share on other sites More sharing options...
jvanegmond Posted May 13, 2011 Share Posted May 13, 2011 (edited) The file i am trying to wait it for DL doesnt have a constant name. It changes everytime i make the report and DL it.Thx a lot again.It's quite hard for us to tell you how to write a script that automates IE when we have no idea on which URL to go to, which buttons to press, maybe select things from a list, do some checkbox operations. The help file has a lot of examples for _IE functions, just have a look.But I'm sure you didn't need us to tell you that when you want to automate IE, you have to look at the IE automation library. Edited May 13, 2011 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
alfa Posted May 13, 2011 Author Share Posted May 13, 2011 It is impossible to show the page that i am working on since it is a company page. What i can tell is it is a SAP generated report. the link i click to get the report shows this as link "https://www5.nikeconnect.com/sap/bw/BEx?SAP-LANGUAGE=EN&PAGENO=1&CMD=EXPORT&DATA_PROVIDER=DP&DUMMY=file%2ecsv&FORMAT=CSV&REQUEST_NO=1" and generated csv files like SAP4LT2Z1ZJXM81P5FXXALGPEH70.csv I just wanted to know how to check the download status in IE. It is obviously over my paygrade Thx Link to comment Share on other sites More sharing options...
jvanegmond Posted May 13, 2011 Share Posted May 13, 2011 O, if all you want to do is wait for it to finish, you can do: While Not FileExists("*.csv") Sleep(100) Wend Just make sure that no .csv files exist in the folder already. Maybe you can even do: FileMove("*.csv", "csvbackup/*.csv") github.com/jvanegmond Link to comment Share on other sites More sharing options...
alfa Posted May 14, 2011 Author Share Posted May 14, 2011 Thanks a lot 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