empach Posted May 31, 2013 Posted May 31, 2013 (edited) Hi, Can someone please tell me what this popup is called and how I can save and rename the file?? Please see attached file for the popup Its been driving me crazy for 3 whole days now : Thanks I have tried using the windows info tool, but when i try to code the details the script doesnt get anywhere. script available if required Edited May 31, 2013 by empach
jdelaney Posted May 31, 2013 Posted May 31, 2013 (edited) that looks like a modal popup, meaning the script won't continue until it's closed (since autoit is not multi threaded). Initiate a second script to perfom the actual click to bring about that window, or initiate a script just prior to clicking what opens it, to interact with the window, and close it. Edited May 31, 2013 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
guinness Posted June 1, 2013 Posted June 1, 2013 What are you trying to do? Saving a PDF receipt? 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
empach Posted June 1, 2013 Author Posted June 1, 2013 that looks like a modal popup, meaning the script won't continue until it's closed (since autoit is not multi threaded). Initiate a second script to perfom the actual click to bring about that window, or initiate a script just prior to clicking what opens it, to interact with the window, and close it. thanks, but I'm not sure how to do that?? which controls should i be looking at??
empach Posted June 1, 2013 Author Posted June 1, 2013 What are you trying to do? Saving a PDF receipt? Hi, I'm trying to download the .pdf and save it under a new name. The pdf needs to be downloaded once a month as its my payslip, but i need to change the name as every month it is called "Payslip"
water Posted June 1, 2013 Posted June 1, 2013 Am I correct that the filename/location changes for security reasons or the file is created on the fly based on your input? So you can't use INetGet to directly download the file? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
empach Posted June 1, 2013 Author Posted June 1, 2013 Am I correct that the filename/location changes for security reasons or the file is created on the fly based on your input? So you can't use INetGet to directly download the file? Basically, I login to a site with my personal details, I select a webpage, then select which month and year I wish to download the payslip from, and then click "show payslip". Then this pops up - where I'm stuck. I have a GUI that logs me in and navigates to the "show payslip" page and clicks on it to get the popup. Now I wish to save the payslip undera new name dependant on which month and year is selected. Below is the HTML code I am trying to read from <label for="Year"> Year:</label> <select name="ctl00$PageBody$ddlYear" onchange="javascript:setTimeout('__doPostBack('ctl00$PageBody$ddlYear','')', 0)" id="ctl00_PageBody_ddlYear" name="input" class="text medium"> <option selected="selected" value="2013">2013</option> </select> <span id="ctl00_PageBody_reqCounty" style="color:Red;visibility:hidden;">*</span> <br /> <br /> <label for="Month"> Month:</label> <select name="ctl00$PageBody$ddlMonth" id="ctl00_PageBody_ddlMonth" name="input" class="text medium"> <option selected="selected" value="23.05.2013">May</option> <option value="23.04.2013">April</option> <option value="22.03.2013">March</option> <option value="22.02.2013">February</option> </select> <span id="ctl00_PageBody_RequiredFieldValidator1" style="color:Red;visibility:hidden;">*</span> <br /> <br /> <div class="divLogin"> <input type="submit" name="ctl00$PageBody$btnShow" value="Show Payslip" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$PageBody$btnShow", "", true, "ValidationSummary1", "", false, false))" id="ctl00_PageBody_btnShow" class="button" /> <input type="submit" name="ctl00$PageBody$btnCancel" value="Cancel" id="ctl00_PageBody_btnCancel" class="button" /> </div> </fieldset> <script type="text/javascript"> //<![CDATA[ var Page_ValidationSummaries = new Array(document.getElementById("ctl00_PageBody_ValidationSummary1")); var Page_Validators = new Array(document.getElementById("ctl00_PageBody_reqCounty"), document.getElementById("ctl00_PageBody_RequiredFieldValidator1")); //]]> </script> <script type="text/javascript"> //<![CDATA[ var ctl00_PageBody_ValidationSummary1 = document.all ? document.all["ctl00_PageBody_ValidationSummary1"] : document.getElementById("ctl00_PageBody_ValidationSummary1"); ctl00_PageBody_ValidationSummary1.validationGroup = "ValidationSummary1"; var ctl00_PageBody_reqCounty = document.all ? document.all["ctl00_PageBody_reqCounty"] : document.getElementById("ctl00_PageBody_reqCounty"); ctl00_PageBody_reqCounty.controltovalidate = "ctl00_PageBody_ddlYear"; ctl00_PageBody_reqCounty.errormessage = "Year is required"; ctl00_PageBody_reqCounty.validationGroup = "ValidationSummary1"; ctl00_PageBody_reqCounty.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid"; ctl00_PageBody_reqCounty.initialvalue = ""; var ctl00_PageBody_RequiredFieldValidator1 = document.all ? document.all["ctl00_PageBody_RequiredFieldValidator1"] : document.getElementById("ctl00_PageBody_RequiredFieldValidator1"); ctl00_PageBody_RequiredFieldValidator1.controltovalidate = "ctl00_PageBody_ddlMonth"; ctl00_PageBody_RequiredFieldValidator1.errormessage = "Month is required"; ctl00_PageBody_RequiredFieldValidator1.validationGroup = "ValidationSummary1"; ctl00_PageBody_RequiredFieldValidator1.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid"; ctl00_PageBody_RequiredFieldValidator1.initialvalue = ""; //]]> </script> <script type="text/javascript"> //<![CDATA[ var Page_ValidationActive = false; if (typeof(ValidatorOnLoad) == "function") { ValidatorOnLoad(); } function ValidatorOnSubmit() { if (Page_ValidationActive) { return ValidatorCommonOnSubmit(); } else { return true; } } //]]> </script> </form> <!-- END BOTTOM PAGE STYLES --> <!-- YOUR CONTENT ENDS BEFORE THIS COMMENT --> </div> </div> <div id="footer" /> </div> </div> </body> </html>
water Posted June 1, 2013 Posted June 1, 2013 Oops, looks a bit complex. I'm not sure this JavaScript can be automated at all. I would create a function that detects the popup window and clicks the button. Use AdLibRegister to call this function every n seconds. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
empach Posted June 1, 2013 Author Posted June 1, 2013 Oops, looks a bit complex. I'm not sure this JavaScript can be automated at all. I would create a function that detects the popup window and clicks the button. Use AdLibRegister to call this function every n seconds. Thanks water, I'll have a look in the help files
empach Posted June 1, 2013 Author Posted June 1, 2013 I've tried AdLibRegister, with no luck Ive also found when I use google chrome the window info says its a widget ????? Is there any way I get control this widget??
water Posted June 1, 2013 Posted June 1, 2013 So Google Chrome is the browser you want to code for? Or should it run with IE and FF too? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
empach Posted June 1, 2013 Author Posted June 1, 2013 I have created a GUI with IE embedded in it, and this is a popup from the webpage
water Posted June 1, 2013 Posted June 1, 2013 Can you post a screenshot of the AutoIt Window Info Tool with the cursor pointing to one of the buttons? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
empach Posted June 1, 2013 Author Posted June 1, 2013 Ok, This is the one from Chrome with the window info of the Save button
water Posted June 1, 2013 Posted June 1, 2013 Try function ControlClick and pass the data displayed as "Advanced Mode" as parameter 3. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
trancexx Posted June 1, 2013 Posted June 1, 2013 Consider other UDFs for the job. My advice would be to use WinHttp.au3 to completely avoid your current problems. ♡♡♡ . eMyvnE
empach Posted June 1, 2013 Author Posted June 1, 2013 (edited) Tried ControlClick("File Download", "&Save", 4427, "left") ControlClick("File Download", "", "[CLASS:Button; INSTANCE:2]") ControlClick("", "", "[CLASS:Button; INSTANCE:2]") but with no joy. I have noticed that my script pauses at the line just before this popup occurs so I may need to focus on the popup but Winactivate doesnt focus it. Edited June 1, 2013 by empach
empach Posted June 1, 2013 Author Posted June 1, 2013 Consider other UDFs for the job. My advice would be to use WinHttp.au3 to completely avoid your current problems. errr???
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