Leaderboard
Popular Content
Showing content with the highest reputation on 03/08/2018 in all areas
-
SOLVED: Get Text from UI
junkew and one other reacted to Earthshine for a topic
ok, update, so I used Microsoft Word 2016 as a sample for this code and made a test docx file, with the text in it--"This is a test." and ran the code below and it RETURNED MY TEXT!! using junkew's wrapper, the one you already use. ;~ *** Standard code Flexible*** #include "UIAWrappers.au3" AutoItSetOption("MustDeclareVars", 1) Local $oP4=_UIA_getObjectByFindAll($UIA_oDesktop, "Title:=This is a test.docx - Word;controltype:=UIA_WindowControlTypeId;class:=OpusApp", $treescope_children) _UIA_Action($oP4,"setfocus") Local $oP3=_UIA_getObjectByFindAll($oP4, "Title:=;controltype:=UIA_PaneControlTypeId;class:=_WwF", $treescope_children) _UIA_Action($oP3,"setfocus") Local $oP2=_UIA_getObjectByFindAll($oP3, "Title:=This is a test.docx;controltype:=UIA_PaneControlTypeId;class:=_WwB", $treescope_children) _UIA_Action($oP2,"setfocus") Local $oP1=_UIA_getObjectByFindAll($oP2, "Title:=This is a test.docx;controltype:=UIA_DocumentControlTypeId;class:=_WwG", $treescope_children) _UIA_Action($oP1,"setfocus") Local $oP0=_UIA_getObjectByFindAll($oP1, "Title:=Page 1;controltype:=UIA_CustomControlTypeId;class:=", $treescope_children) ;~ First find the object in the parent before you can do something ;~$oUIElement=_UIA_getObjectByFindAll("Page1content.mainwindow", "title:=Page 1 content;ControlType:=UIA_EditControlTypeId", $treescope_subtree) Local $oUIElement=_UIA_getObjectByFindAll($oP2, "title:=Page 1 content;ControlType:=UIA_EditControlTypeId", $treescope_subtree) ;~_UIA_action($oUIElement,"highlight") Local $string = _UIA_action($oUIElement,"getValue") MsgBox($MB_OK,"", $string)2 points -
Version 1.6.3.0
17,293 downloads
Extensive library to control and manipulate Microsoft Active Directory. Threads: Development - General Help & Support - Example Scripts - Wiki Previous downloads: 30467 Known Bugs: (last changed: 2020-10-05) None Things to come: (last changed: 2020-07-21) None BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort1 point -
Automate all windows and browser applications with one UDF function library. Based on the microsoft automation API this library high level supports Recognition of conttrols from EDGE, Chrome, FF, Opera, Safari and Windows native apps Small testing framework to split object repository from coding away Introduction Quickstart - Getting started quickly Simple scripts With this module you can automate all applications/programs that support ui automation and/or accesibility api from microsoft you can recognize more controls than AutoIT can recognize "out of the box" you can use concepts from other testing frameworks like http://download.freedesktop.org/ldtp/doc/ldtp-tutorial.pdf http://safsdev.sourceforge.net/Default.htm coded ui testing from microsoft Some of those controls / applications are chrome browser (partly mainwindow has to be done with MSAA for navigating) chrome://accessibility in the adress bar of chrome or start with "--force-renderer-accessibility" silverlight controls Ribbon control controlbars of Excel/Word IE and FF browsers Windows Media Player Windows clock AFX .. controls (partly) .... Based on the initial AIO Object I now have made the interface file to work with objCreateInterface function which is in the latest beta's automate clicking and querying basic information It gives you a lot of basic information to be able to automate clicking, querying basic information where it goes further in certain situations than AutoIt is identifying Starting threads for background on the ui automation api of microsoft (not for starters) http://en.wikipedia.org/wiki/Microsoft_UI_Automation http://msdn.microsoft.com/en-us/library/ms747327.aspx Previous threads in general help/support Interface AutoItObject IUIAutomation ObjCreateInterface and struct tagPoint in method ElementFromPoint Be aware that API is not allways installed under XP/Vista see http://support.microsoft.com/kb/971513 Within Windows 7 and Windows 8 it should be preinstalled by default. Be aware on 32 and 64 bits way of running your script #AutoIt3Wrapper_UseX64=Y or N Basic example of usage / showing and retrieving the default information, will post multiple examples later Hover your mouse to an area of interest and press ctrl+w and information will be shown in the edit box of the form Simple spy demo (see simplespy.au3 or use latest ZIP attachment for latest version) Main features Recognize windows and html controls for the major browsers Logical and physical description for controls (UI mapping, Application map) Simple repository logic to abstract logical and physical descriptions Store Runtime Type Information in RTI. variables Rubberbanding/highlighting of objects Simple spy to help in making / identifying the physical description Support of regular expression(s) in identifying objects recognize objects on multiple properties supported properties: name ,title, automationid, classname, class, iaccessiblevalue, iaccessiblechildId, controltype, processid, acceleratorkey The actions provided so far "leftclick", "left", "click", "leftdoubleclick", "leftdouble", "doubleclick", _ "rightclick", "right", "rightdoubleclick", "rightdouble", _ "middleclick", "middle", "middledoubleclick", "middledouble", "mousemove", "movemouse" "setvalue","settextvalue" "setvalue using keys" "setValue using clipboard" "getvalue" "sendkeys", "enterstring", "type", "typetext" "invoke" "focus", "setfocus", "activate" "close" "move","setposition" "resize" "minimize", "maximize", "normal", "close", "exist", "exists" "searchcontext", "context" "highlight" "getobject","object" "attach" "capture","screenshot", "takescreenshot" "dump", "dumpthemall" "propertyvalue", "property" match on multiple properties like: name:=((Zoeken.*)|(Find.*)); ControlType:=Button; acceleratorkey:=Ctrl+F Support for 117 different properties see $UIA_propertiesSupportedArray in uiawrappers like for example title, regexptitle, class, regexpclass, iaccessiblevalue, iaccessiblechildid, name, accesskey, automationid, classname IAccessible, IAccessible2, ISimpleDom interfaces debuglogging to a file log.txt (no output in scitewindow) Examples Example 1 Iterating thru the different ways of representing the objects in the tree (#comment-1105548) Example 2 Finding the taskbar and clicking on the start menu button (#comment-1105680) Example 3 Clicking a litlle more and in the end displaying all items from the clock (thats not directly possible with AU3Info) (#comment-1108849) Example 4 that demonstrates the calculator Example 5 Automating chrome Example 6 Demonstrates all stuff within chrome to navigate html pages, find hyperlink, click hyperlink, find picture, click picture, enter data in inputbox Example 7 The chrome example modified to a firefox example Example 8 The other major browser Internet Explorer automated (made on Example 6 and 7) Example 9 Windows media player Example 10 Automating mach 3 (AFX windows and other hard to get recognized by AutoIT) Lot of links are broken due to forum upgrade just search for the text like "Example 11 Demonstrate Word, Notepad and Calculator actions" Example 11 Demonstrate Word, Notepad and Calculator actions ... Example 13 Details 1 about the right pane of the windows explorer Example 14 Details 2 about the right pane of the windows explorer Example 15 Details 3 about the right pane of the windows explorer Example 16 Details 4 about the right pane of the windows explorer Example 17 Details 5 about the right pane of the windows explorer WITH CACHING Example 18 Details 6 about the right pane of the windows explorer WITH VIRTUAL ITEMS Example 19 Eventhandling examples Example 20 Eventhandling examples Example 21a Eventhandling examples Internet Explorer Example 21b Eventhandling examples Internet Explorer Example 22 Eventhandling examples Follow focus Example 23 Eventhandling examples structure changed Example 24 Eventhandling examples IUIAutomationEventHandler Example 25 SAFEARRAYS Example 26 IACCESSIBLE / MSAA Example 27 IACCESSIBLE2 / MSAA Example 28 IACCESSIBLE / MSAA events Example 29 IACCESSIBLE2 events Example 30 ISimpleDOM Example 31 Notepad window move, maximize, minimize Example 32 Three browsers doing the same stuff with small differences in scripting only .. TODO Build recorder Enhance the spy with a nicer UI UI for the repository (now in the script with dot notation) Enhance mapping / identifying on multiple properties instead of 1 combined with index If speed becomes an issue use the caching logic of the MS UIA framework Add the other patterns later Generalize the concept of System Under Test of starting the SUT (for testing framework purposes) Remote running of scripts Fix issue on finding within dynamic context ... edit august 18th 2013 initial post Only zip files are needed to download , just unzip in 1 directory edit july 2016 Made V0_63 and examples works with AutoIt v3.3.14 Windows 10 tested Simple spy gives some basic code as a present Chrome latest versions seems to be having issues with IUIAutomation on tabs/buttons of mainwindow use MSAA for accessing tabsheets / buttons more cleanup to be in UDF style More comments in the source see changelog.txt for previous changes edit september 2017 All examples fixed for the IE, Firefox and Chrome browser Some small but essential fixes in UIAWrappers edit april 2018 Enhanced logic on fallback / dynamic search, still not perfect, to slow Retested with latest Chrome, FF, Edge and IE11 and some extensions to show how to get text from the webpage (examples 5,6,7) Some small bugfixes Some comments as given in forum incorporated edit may 2019 Speed enhancements on especially fallback searching UIA.CFG works now in a better way to turn on/off debug, highlighting, debug2file More stable and consistent behavior Internal cleanup and refactoring of bigger functions Checked with W10 (not tested on W7) Added some W10 properties Run with 3.3.14.5 on W10 UIA_V0_51.zip EXAMPLES_V0_5.zip UIA_V0_63.zip EXAMPLES_V0_63.zip UIA_V0_64.zip EXAMPLES_V0_64.zip EXAMPLES_V0_66.zip UIA_V0_66.zip EXAMPLES_V0_70.zip UIA_V0_70.zip1 point
-
As the WebDriver UDF - Help & Support thread has grown too big, I started a new one. The prior thread can be found here.1 point
-
SOLVED: Get Text from UI
Earthshine reacted to gvp9000 for a topic
I had the same problem too, thank you1 point -
1 point
-
SOLVED: Get Text from UI
Jasp402 reacted to Earthshine for a topic
I see there is a thread where you can set the text, I bet you can get the text in such a way? _UIA_action("204022.mainwindow","setvalue using keys","hello world") maybe _UIA_action("YourApp","getValue") YES, i looked in the UIWrappers.au3, there is an 'getValue' you should be able to use!1 point -
SOLVED: Get Text from UI
toto22 reacted to Earthshine for a topic
ya, try that one from GitHub mate. it also has the gettext function hey, is it our Jos? https://github.com/jvanegmond1 point -
SOLVED: Get Text from UI
Earthshine reacted to toto22 for a topic
you know it does find object and highlights and clicks it. However getting text is a whole different story. there should be a command to show text or header. Im taking a lil break now. thank you brotha1 point -
SOLVED: Get Text from UI
toto22 reacted to Earthshine for a topic
can you do this? $oUIElement=_UIA_getObjectByFindAll($oP0, "title:=*;ControlType:=UIA_TextControlTypeId", $treescope_subtree)1 point -
SOLVED: Get Text from UI
Earthshine reacted to toto22 for a topic
Thank you so much for your help. However, It still returns blank message box. Ill keep playing with it and if I make any progress, ill let you know. Thank you so much for your time and help1 point -
SOLVED: Get Text from UI
toto22 reacted to Earthshine for a topic
;~ *** Standard code maintainable *** #include "UIAWrappers.au3" AutoItSetOption("MustDeclareVars", 1) local $oP1 = _UIA_setVar("oP1","Title:=TC2000 ® Version 17.0.6435.29524;controltype:=UIA_WindowControlTypeId;class:=Window") ;TC2000 ® Version 17.0.6435.29524 local $oP2 = _UIA_setVar("oP2","Title:=;controltype:=UIA_CustomControlTypeId;class:=WorkspaceTabControl") ; local $oP3 = _UIA_setVar("oP3","Title:=;controltype:=UIA_CustomControlTypeId;class:=WebChart") Local $oUIElement=_UIA_getObjectByFindAll($oP3,"Title:=;controltype:=UIA_TextControlTypeId;class:=TextBlock") MsgBox(1,"",$oUIElement) try it1 point -
You'll need to trigger the attached jQuery change event. Here's one way to do it -- #include <IE.au3> #include <MsgBoxConstants.au3> Local $strMainURL = "http://bidfta.bidqt.com/BidFTA/#/Main" Local $oIE = _IECreate($strMainURL) MsgBox(0,"pause","Press ok when page is ready") Local $oSelect = _IEGetObjByName($oIE, "LocationSelect") ;ControlSend("Main - Internet Explorer","","","e") _IEFormElementOptionSelect($oSelect,"Amelia, OH",1,"byText") Local $jQuery = _jQuerify($oIE) $jQuery("[name='LocationSelect']").trigger('change') MsgBox(0,"Done","Done") _IEQuit($oIE) ; #FUNCTION# ==================================================================================================================== ; Name ..........: _jQuerify ; Description ...: ; Syntax ........: _jQuerify(Byref $oIE) ; Parameters ....: $oIE - Object variable of an InternetExplorer.Application. ; Return values .: an object variable pointing to the jQuery library ; Author ........: Chimp ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: ; =============================================================================================================================== Func _jQuerify(ByRef $oIE) Local $msie, $jsEval, $jQuery, $otherlib = False $msie = Execute('$oIE.document.documentMode') If ($msie = "") Or Number($msie) < 11 Then ; an IE version < 11 ; create a reference to the javascript eval() function $oIE.document.parentWindow.setTimeout('window.eval = eval', 0) Do Sleep(250) $jsEval = Execute('$oIE.Document.parentwindow.eval') Until IsObj($jsEval) Else ; IE version > = 11 ; create a reference to the javascript eval() function $oIE.document.parentWindow.setTimeout('document.head.eval = eval', 0) Do Sleep(250) $jsEval = Execute('$oIE.Document.head.eval') Until IsObj($jsEval) EndIf ; if jQuery is not already loaded then load it If $jsEval("typeof jQuery=='undefined'") Then ; check if the '$' (dollar) name is already in use by other library If $jsEval("typeof $=='function'") Then $otherlib = True Local $oScript = $oIE.document.createElement('script'); $oScript.type = 'text/javascript' ; If you want to load jQuery from a disk file use the following statement ; where i.e. jquery-1.9.1.js is the file containing the jQuery source ; (or also use a string variable containing the whole jQuery listing) ;~ $oScript.TextContent = FileRead(@ScriptDir & "\jquery-1.9.1.js") ; <--- from a file ; If you want to download jQuery from the web use this statement $oScript.src = 'https://code.jquery.com/jquery-latest.min.js' ; <--- from an url $oIE.document.getElementsByTagName('head').item(0).appendChild($oScript) Do Sleep(250) Until $jsEval("typeof jQuery == 'function'") EndIf Do Sleep(250) $jQuery = $jsEval("jQuery") Until IsObj($jQuery) If $otherlib Then $jsEval('jQuery.noConflict();') Return $jQuery EndFunc ;==>_jQuerify1 point
-
SOLVED: Get Text from UI
toto22 reacted to Earthshine for a topic
well, to be fair, this is the IUIAutomation wrapper written by @junkew you are using, no? He will probably be around and see this. He's who I would ask. also, what you use in C# is none other than a wrapper. which is ok.1 point -
Unable to Send text to a specific application
Danp2 reacted to Earthshine for a topic
what application are you trying to automate? Outlook? post pics of the Info Tool, each tab. this means next to nothing. it's ironic, reading this thread's title, '...A SPECIFIC APPLICATION', yet the specific application was not mentioned.... lol1 point -
Look here how to monitor ClipBoard changes and call your code only at changes:1 point
-
Local $count = $oWorkbook2.Worksheets(1).UsedRange.Columns.Count returns the correct column number when the used range starts with column A. If it starts with another column then the result is wrong. Try: #include <Excel.au3> Global $oExcel = _Excel_Open() Global $oWorkbook = _Excel_BookOpen($oExcel, "C:\Program Files (x86)\AutoIt3\Examples\Helpfile\Extras\_Excel1.xls") Global $iLastColumn = $oExcel.Range("A1").SpecialCells($xlCellTypeLastCell).Column ConsoleWrite($iLastColumn & @CRLF) ; Last used column as number ConsoleWrite(_Excel_ColumnToLetter($iLastColumn) & @CRLF) ; Last used column as letter1 point
-
_Excel_ColumnToLetter1 point
-
Couple of examples: #include <Array.au3> _Example1() MsgBox(32, "Reset Selection", "Reset Selection for Example 2") _Example2() Exit Func _Example1() Local $sClip WinWait("Sample Selection Box") WinActivate("Sample Selection Box") Sleep(250) Local $aArray[1]= ["SampleID's"] Local $i = 1 While 1 Send("^c") Send("{Down}") Sleep(250) $sClip = StringStripWS(ClipGet(), 7) If StringStripWS($sClip, 8) = "" Then ExitLoop Else ReDim $aArray[UBound($aArray) + 1] $i += 1 $aArray[$i-1] = $sClip EndIf ConsoleWrite("Var is: " & $aArray[$i-1] & " this cycle." & "Counter is:" & $i - 1 & @CRLF) WEnd _ArrayDisplay($aArray, "Total Copied From Available") EndFunc Func _Example2() Local $sClip WinWait("Sample Selection Box") WinActivate("Sample Selection Box") Sleep(250) Local $aArray[1]= ["SampleID's"] Local $i = 0 Do Send("^c") Send("{Down}") Sleep(100) $sClip = StringStripWS(ClipGet(), 7) If StringStripWS($sClip, 8) <> "" Then ReDim $aArray[UBound($aArray) + 1] $i += 1 $aArray[$i] = $sClip EndIf ConsoleWrite("Var is: " & $aArray[$i] & " this cycle." & "Counter is:" & $i & @CRLF) Until StringStripWS($sClip, 8) = "" _ArrayDisplay($aArray, "Total Copied From Available") EndFunc1 point
-
x_bennY, That is an unfortunate "feature" of the ListView control - it tries to display the full width of all items when they are inserted - and nothing to do with my UDF as such. I added an optional parameter for inserting elements which automatically reset the column widths - you can do something similar in the short term: <snip> I will take a look and see if I can get the UDF to do this automatically for drag/drop by using an optional parameter somewhere. M23 Edit: Actually a pretty easy fix to get the UDF to do this - I am assuming that all column widths will remain constant when drag/drop is used. Try this Beta version and let me know what you think:1 point
-
Don't know exactly what info you're looking for.. but check out this if you want an easy to follow Youtube Video/Series, I recommend watching his AutoIt Series from the very begging:1 point
-
Ok I'll try to do a quick rundown Tabs Window - Literally the window itself, its generally the parent window but sometimes you can only get a child window Control - Sometimes this works sometimes not but it will be an individual control on the window Visible Text - Literally text that can be seen Hidden Text - Sometimes controls have hidden text and sometimes window info can find it StatusBar - text in that little status bar on the bottom of some windows and their index ToolBar - items in a toolbar and their index Mouse - Mouse position and color under cursor Summary - All of the above Frozen just makes it so once you drop the target it keeps the info from the window as it was when you dropped it I'd suggest pointing it at a few windows and see what you see like the autoit help file for instance As for mouse coords thats a terrible way to do anything unless you have to In the help file Checkout Controls ContrlSend and try some the examples within Between the autoit help file and the forum there isn't much you can't do If you get stuck post your code using the <> and someone will help you1 point
-
@Miliardsto hooked me up with the files he used here and the github for that is: https://github.com/ellysh/ImageSearch But I haven't had time to test that yet.. but what worked for me was the attached zip file, I butchered the Example File so if you should know that other available functions are listed in the _ImageSearch.au3 file, four total (_IMGSearch_Area, _IMGSearch, _IMGSearch_Wait, _IMGSearch_WaitArea) image files.zip1 point
-
x_bennY, Please provide me with a small reproducer script and a set of instructions so that I can see just what you are doing. M231 point
-
Using the above libary you just need to do: _SetChannelVolumeLevel(0,-12.5) If the audio stream contains n channels, the channels are numbered from 0 to n– 1 Saludos1 point