seadoggie01 Posted November 18, 2019 Share Posted November 18, 2019 Just now, Nine said: I tested the DownloadComplete event and it doesn't work on Download File. It only works on navigation. Well, that seems counter intuitive All my code provided is Public Domain... but it may not work. Use it, change it, break it, whatever you want. Spoiler My Humble Contributions:Personal Function Documentation - A personal HelpFile for your functionsAcro.au3 UDF - Automating Acrobat ProToDo Finder - Find #ToDo: lines in your scriptsUI-SimpleWrappers UDF - Use UI Automation more Simply-erKeePass UDF - Automate KeePass, a password managerInputBoxes - Simple Input boxes for various variable types Link to comment Share on other sites More sharing options...
Nine Posted November 18, 2019 Share Posted November 18, 2019 1 minute ago, seadoggie01 said: Well, that seems counter intuitive Agree “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
JoeBar Posted November 18, 2019 Author Share Posted November 18, 2019 When i first saw this on M$ API, i thought it was the good one, and then, the deception 😊 seadoggie01 1 Link to comment Share on other sites More sharing options...
JoeBar Posted November 18, 2019 Author Share Posted November 18, 2019 (edited) 4 hours ago, seadoggie01 said: I was taking a look at my code and I just use FileExists checks before opening the download. I just tested it with a large zip file and it won't open until the file is downloaded completely It's working : Local $isfile = 0 Do $isfile = FileExists($sFileSelectFolder & "\" & $fileDL) Sleep(500) Until $isfile = 1 But I have another problem, with this automation, if the user wants to download more than once, the path is already opened when the Save As window appears, then the "ControlClick("Save As", "", "&Save", "left", 1, 5, 5)" keeps ckicking and it get freezed here. Apparently, you cannot enter the same path as the same that is loaded. This line must be skipped if the precedent download is in the same path, but i don't know how to deal with it. Edited November 18, 2019 by JoeBar Link to comment Share on other sites More sharing options...
seadoggie01 Posted November 18, 2019 Share Posted November 18, 2019 32 minutes ago, JoeBar said: It's working Yay! I didn't quite get the rest of the post... I think you're talking about the user selecting a file that already exists? Just check before attempting the download. Something like Local $sFileName = "" Do $sFileName = FileOpenDialog("Select", @ScriptDir, "All(*.*)") If FileExists($sFileName) Then $sFileName = "" MsgBox($MB_ERROR, "File Already Exists", "Please select a new file name.") EndIf Until $sFileName <> "" All my code provided is Public Domain... but it may not work. Use it, change it, break it, whatever you want. Spoiler My Humble Contributions:Personal Function Documentation - A personal HelpFile for your functionsAcro.au3 UDF - Automating Acrobat ProToDo Finder - Find #ToDo: lines in your scriptsUI-SimpleWrappers UDF - Use UI Automation more Simply-erKeePass UDF - Automate KeePass, a password managerInputBoxes - Simple Input boxes for various variable types Link to comment Share on other sites More sharing options...
JoeBar Posted November 18, 2019 Author Share Posted November 18, 2019 (edited) 5 minutes ago, seadoggie01 said: Yay! I didn't quite get the rest of the post... I think you're talking about the user selecting a file that already exists? Just check before attempting the download. Something like Local $sFileName = "" Do $sFileName = FileOpenDialog("Select", @ScriptDir, "All(*.*)") If FileExists($sFileName) Then $sFileName = "" MsgBox($MB_ERROR, "File Already Exists", "Please select a new file name.") EndIf Until $sFileName <> "" No, it's when the automatic insertion of the path doesn't work cause we are already in this path and it freeze the Save button. I'm trying to make it by writing to [CLASS:ToolbarWindow32; INSTANCE:3] with ControlSend and ControlSetText, but nothing works. Edited November 18, 2019 by JoeBar seadoggie01 1 Link to comment Share on other sites More sharing options...
seadoggie01 Posted November 19, 2019 Share Posted November 19, 2019 Can you post the code? I'm confused, but I think that you mean you try to input the path into the top Edit control of the Save As dialog box each time and the file name into the bottom Edit control. If that's the case, just type the full path to the bottom edit. All my code provided is Public Domain... but it may not work. Use it, change it, break it, whatever you want. Spoiler My Humble Contributions:Personal Function Documentation - A personal HelpFile for your functionsAcro.au3 UDF - Automating Acrobat ProToDo Finder - Find #ToDo: lines in your scriptsUI-SimpleWrappers UDF - Use UI Automation more Simply-erKeePass UDF - Automate KeePass, a password managerInputBoxes - Simple Input boxes for various variable types Link to comment Share on other sites More sharing options...
JoeBar Posted November 19, 2019 Author Share Posted November 19, 2019 (edited) 11 hours ago, seadoggie01 said: Can you post the code? I'm confused, but I think that you mean you try to input the path into the top Edit control of the Save As dialog box each time and the file name into the bottom Edit control. If that's the case, just type the full path to the bottom edit. ;save as - Dont need to change any of this except for filepath. WinActivate("Enregistrer sous", "Enregistrer") ; WinWaitActive("Enregistrer sous", "Enregistrer", 10) ; ControlSetText("Enregistrer sous", "", "Edit1", $sFileSelectFolder) ControlClick("Enregistrer sous", "", "&Enregistrer", "left", 1, 5, 5) Sleep(100) ControlClick("Enregistrer sous","","&Enregistrer", "left", 1, 0, 0) It's this part, i had made the way you described, it was working since the last download path opened in the IE Save As window was not the same in which you want to Save your next file. Just try to open a FileSave window and paste the same path as opened and try to click Save, it will do nothing, that's my problem. The solution would be to paste on [CLASS:ToolbarWindow32; INSTANCE:3] instead of in Edit, but i cannot with ControlSend norControlSetText. Edited November 19, 2019 by JoeBar Link to comment Share on other sites More sharing options...
seadoggie01 Posted November 19, 2019 Share Posted November 19, 2019 I'm not the best with words... The top right box with the up arrow is "[CLASS:ToolbarWindow32; INSTANCE:3]" for me, but I think you meant the box next to it. The inside box on the bottom is the edit where I put the full path (the outside is a combo box that is super annoying). I never touch the top right box with the current path inside it, it doesn't matter if you put the full path in the edit box. I tried overwriting my file and saving to the same path, and both worked here, though there is a msgbox asking if I want to replace my current download which I need to accept first. All my code provided is Public Domain... but it may not work. Use it, change it, break it, whatever you want. Spoiler My Humble Contributions:Personal Function Documentation - A personal HelpFile for your functionsAcro.au3 UDF - Automating Acrobat ProToDo Finder - Find #ToDo: lines in your scriptsUI-SimpleWrappers UDF - Use UI Automation more Simply-erKeePass UDF - Automate KeePass, a password managerInputBoxes - Simple Input boxes for various variable types Link to comment Share on other sites More sharing options...
JoeBar Posted November 19, 2019 Author Share Posted November 19, 2019 (edited) Yes, i was talking about the "This PC > Downloads..." control, you can paste the path even when it's the same path that is currently displayed. (This cannot be done in the Edit1). Another thing, i cannot put the filename, since i get it automatically when i make my clicks. (the filename is automatically generated as said in 1st post). Just test my script, you will see what i'm talking about. That's freezed here, you cannot validate with Save : Here you can : The problem is there seems to be 2 differents display path for the Desktop, the 1st doesn't work to Save, the 2nd works. For the replace file box, i will do it after the "path problem" Edited November 19, 2019 by JoeBar Link to comment Share on other sites More sharing options...
seadoggie01 Posted November 19, 2019 Share Posted November 19, 2019 I can't test your script, it runs on a NAS that I don't have access to and the words are in ... French? You'll need to put the file name in the edit box too... like "C:\Users\JoeBar\Desktop\file.zip" and then it should save fine regardless of the location that is displayed. If that doesn't work, I'm out. I've had this working on four separate computers with Windows 10 and 7. All my code provided is Public Domain... but it may not work. Use it, change it, break it, whatever you want. Spoiler My Humble Contributions:Personal Function Documentation - A personal HelpFile for your functionsAcro.au3 UDF - Automating Acrobat ProToDo Finder - Find #ToDo: lines in your scriptsUI-SimpleWrappers UDF - Use UI Automation more Simply-erKeePass UDF - Automate KeePass, a password managerInputBoxes - Simple Input boxes for various variable types Link to comment Share on other sites More sharing options...
JoeBar Posted November 19, 2019 Author Share Posted November 19, 2019 (edited) 28 minutes ago, seadoggie01 said: I can't test your script, it runs on a NAS that I don't have access to and the words are in ... French? You'll need to put the file name in the edit box too... like "C:\Users\JoeBar\Desktop\file.zip" and then it should save fine regardless of the location that is displayed. If that doesn't work, I'm out. I've had this working on four separate computers with Windows 10 and 7. Sorry i forgot that, i picked the script in a topic with a functionnal example, you could test if i find it. The original script didn't involve putting name manually as we get it only on the Save As window, the goal was to set the path, and push twice the Save button (once to enter the path, the second to Save the file under the filename that appeared meanwhile). Edited November 19, 2019 by JoeBar 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