The-dude Posted January 16, 2020 Share Posted January 16, 2020 Hi All, I'm trying to write a script that takes the results from the window below, looks for only the numbers after the text "value:" (nothing beyond those numbers) and then copies that number and sends it to another windows input box. I've written the basic code to the point it waits until this window pops up... I'm just not sure how to write the remaining portion of the script. Any and all help would be greatly appreciated! Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted January 17, 2020 Moderators Share Posted January 17, 2020 What have you tried on your own thus far? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
The-dude Posted January 17, 2020 Author Share Posted January 17, 2020 @JLogan3o13 See below, the $sText variable provides me with the data in the message box but I'm not sure what the formula would be for narrowing down the data to show only the information after the "value:" text and only 12 spaces after that. Then use that text to copy into another GUI's input window. #include <MsgBoxConstants.au3> While 1 WinWait("WindowTitle", "TextToFindInWindow") Local $sText = ControlGetText("WindowTitle", "", "WindowClassInstance") MsgBox(0, "", $sText) ExitLoop WEnd Link to comment Share on other sites More sharing options...
The-dude Posted January 17, 2020 Author Share Posted January 17, 2020 (edited) @JLogan3o13 I've managed to narrow down the "Value:" data using an array by adding the following code, just not sure how to utilize that text after this point to send it to the input box- $string = $sText $array1 = StringSplit($string,"Value:,.",2) _ArrayDisplay($array1, "", "23:23") (Revision1) I've also tried ArrawyToClip but I'm not fully understanding how to send that array data, testing with notepad. $string = $sText $array1 = StringSplit($string,"Value:,.",2) _ArrayToClip($array1, "", "23", "23") MsgBox($MB_SYSTEMMODAL, "_ArrayToClip()", ClipGet()) Run("notepad.exe") Sleep(2000) Send("_ArrayToClip()", ClipGet()) ;DOES NOT WORK (Revision2) I was able to get send the text using the below, "hello" was just apart of the test. $Var = StringStripWS(ClipGet(), 😎 Send("Hello " & $Var) Edited January 17, 2020 by The-dude Link to comment Share on other sites More sharing options...
caramen Posted January 19, 2020 Share Posted January 19, 2020 The way to use ClipGet / ClipPut : ClipPut("123") $cVar0 = "ABC" $cVar1 = ClipGet () MsgBox($MB_SYSTEMMODAL, "_ArrayToClip()", $cVar1) ClipPut($cVar0) $cVar1 = ClipGet () MsgBox($MB_SYSTEMMODAL, "_ArrayToClip()", $cVar1) 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...
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