Search the Community
Showing results for tags 'automate getting ms store apps'.
-
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