MovieScreener2013 Posted January 6, 2019 Share Posted January 6, 2019 Below is a function I created to open the Microsoft Store and open the search box paste in the $xMSAppName and select it then tab to the GET button and select for download. My question is around navigation of the MS Store. Does anyone have anything that they can offer for making this better. I am sure there must be a better way to do this I am just not that adept at this yet. I tried using the tool to get the information on the window but it isn't offering me anything to grab onto. It's like one big window. Any help breaking down this issue would be great help. Thanks as always. TJ =================================================================================== Func MS_Store_GET_APP_Inst($xMSAppName) AutoItSetOption('MouseCoordMode', 0) AutoItSetOption('SendKeyDelay', 300) AutoItSetOption("WinTitleMatchMode", 2) ; SplashText Message $sMessage = $xMessageAIP & @LF & $xMessagePRF & @LF & $xMessageDU2 & @LF & $xMSAppName & " - Install Running" SplashTextOn($xMessageBoxTitle, $sMessage, 300, 125, 1, 1, 0, "") $xScriptName = "Power_BI_Dsktp_Inst" ; Setting $sScriptName $ecode = 404 ; Setting error code to 404 in the event of a failure. ; Opening the Microsoft Store to get the X2 Apps: Sleep(500) Send("{LWIN}Store{ENTER}") Sleep(500) ; Getting Power BI Desktop from Microsoft Store: Local $xTitle = "Store" Local $xText = "Store" $hWnd = WinWait($xTitle, $xText) WinActivate($xTitle, $xText) $CopyPaste1 = $xMSAppName ClipPut($CopyPaste1) Sleep(10000) ; Found that Cntr + e activates the search box. This is predictable!! Send('^e^v') Sleep(2500) Send("{Down}{ENTER}") Sleep(8000) ; The next command is for MS Store that is established and has a linked account: Send("^e{TAB 9}{ENTER 2}") ; Send("{ENTER}") ; MsgBox(0,1,1) Local $xTitle = "Try again later" Local $xText = "" $hWnd = WinWait($xTitle, $xText, 30) If $hWnd <> 0 Then WinActivate($xTitle, $xText) Send("{ENTER}") Local $xTitle = "Store" Local $xText = "Store" $hWnd = WinWait($xTitle, $xText) WinActivate($xTitle, $xText) MouseClick("Right", 440, 18, 1, 0) Send("{DOWN 6}{ENTER}") $xLogFileMessage = $xMSAppName & " -- GET APP has FAILED! " & @CRLF & " -- Something is apparently wrong with MS Store -- " & @CRLF & " -- Report this event to Automation Specialist -- " & @CRLF ScriptLogging() ; Writing out to the script logging file. $ecode = "411" ; Setting error code to 411 EventLog() ; Write to Application log in Event Viewer file. StopMessageBox1() Else Local $xTitle = "Store" Local $xText = "Store" $hWnd = WinWait($xTitle, $xText) WinActivate($xTitle, $xText) ; ControlClick($hWnd, "", "", "Right", 1, 440, 18) MouseClick("Right", 440, 18, 1, 0) Send("{DOWN 6}{ENTER}") $xLogFileMessage = $xMSAppName & " -- GET APP has Finished! " & @CRLF & " -- Script completed Successfully! -- " & @CRLF ScriptLogging() ; Writing out to the script logging file. $ecode = "411" ; Setting error code to 411 EventLog() ; Write to Application log in Event Viewer file. InfoMessageBox4() EndIf EndFunc ;==>MS_Store_GET_APP_Inst Link to comment Share on other sites More sharing options...
caramen Posted January 7, 2019 Share Posted January 7, 2019 If you try to make a sample with IUIAutomation: look my signature. We gonna help you. MovieScreener2013 1 My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
MovieScreener2013 Posted January 7, 2019 Author Share Posted January 7, 2019 Trying to digest all of Junkew's posts and information.... wholly crow!!! Link to comment Share on other sites More sharing options...
caramen Posted January 7, 2019 Share Posted January 7, 2019 You are already on the success way then :). If i did it, you can do it. MovieScreener2013 1 My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
junkew Posted January 15, 2019 Share Posted January 15, 2019 See FAQ 31 If just Internet Explorer use IE.UDF If not UIAutomation can be an alternative or if only html you could use webdriver udf FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
MovieScreener2013 Posted January 15, 2019 Author Share Posted January 15, 2019 (edited) Well it's not Internet Explorer. Its Microsoft Store, while I'm sure it may be similar it's not within IE. I am trying to run through the simple scripts you have setup Calculator specifically and I am getting errors on several functions it doesn't seem to be able to find: #include "UIAWrappers.au3" ; NOTE: this was also in the simplespy.au3 script and that one worked so I'm assuming this is a false positive. and then the following which makes more sense since I don't see them in the list of UDF's that I have: _UIA_SETVAR() _UIA_SETVARFROMARRAY() why would these be missing from the zip file? ======================================================================================================================= UPDATE: The functions above are in the UIAWrppers.au3 but for some reason my system stopped seeing the UDF directory I had set?? strange! I'm getting a bit further now. have it highlighting the button and Clicking it is next but for some reason the SciTE Script editor keeps giving me an error 1 code and closing?? another interesting behaviour. I'm going to attempt to uninstall fully and re-install autoIT to see if that resolves these strange behavioural issues. Edited January 15, 2019 by MovieScreener2013 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