Leaderboard
Popular Content
Showing content with the highest reputation on 01/27/2019 in all areas
-
The GUI looks like shown in the picture: It contains a main menu, a treeview in left pane that lists UI Automation elements, a listview in right pane that displays detail information for the selected element, and a splitterbar to adjust the width of the two panes. Detect element The "Detect element" main menu is used to detect elements under the mouse with function keys F1 - F4. See How to topics number 2. Left pane The left pane is a treeview that initially lists open programs and windows. Generally, the left pane shows UI Automation elements represented as treeview items. Right pane The right pane is a listview that displays detail information for the selected treeview element. The information is grouped into different types of information. Only the relevant information for each type is displayed. Invalid elements When a window is closed the elements in UIASpy becomes invalid. But the elements are not deleted in UIASpy and can still be handled and selected in the treeview. Detail information for an element that was calculated before the window was closed can still be seen in the listview. In this way it's possible for UIASpy to show information for eg. a context menu that is closed as soon as it loses focus. Listview features Listview features Help system With completion of the Help system, a lot of information has been moved from this post and other posts into the Help system. Sample code creation Sample code creation is implemented through the UI element Detail info listview page and through the Sample code main menu. Sample code creates code snippets based on data in one or more selected rows in the Detail info listview page or based on the clicked Sample code menu item. UI Automation code is largely based on COM interface objects and thus on the function ObjCreateInterface(), which is one of the advanced functions in AutoIt. The main purpose of Sample code functionality is to eliminate the complexity of ObjCreateInterface(). Sample code creation either through the Detail info listview page or through the Sample code main menu can create all the interface objects required in UI Automation code. Another purpose is of course to make it easier and faster to implement code for simple automation tasks. Through Sample code creation, you can more or less create all code in a simple automation task: Create UI Automation initial code Create condition and find application window Create condition and find control in window Get information about windows and controls Create pattern objects to perform actions Get information related to pattern objects Perform actions with pattern object methods Add a Sleep() statement if necessary Note that the UI element used in sample code is named after the selected element in the treeview. Also note that both the Sample code menu items and the sections in the Detail info listview page are placed in approximately the order they are used in a simple automation task. Sample code creation through Detail info listview page Sample code creation through Sample code main menu Supported applications Most browsers including Google Chrome To be able to spy on web content in Google Chrome it's necessary to enable accessibility by entering chrome://accessibility/ in the address bar of a new tab item, and then check the five check boxes that are located in a column in upper left corner down along the left edge. Then the accessibility tab can be closed again. It's a global setting that applies to all open and new tabs until Chrome is closed. Without accessibility enabled you are only able to investigate the outer elements of Chrome but not web content. Internet Explorer Microsoft Edge Mozilla Firefox Most Microsoft applications and applications developed with Microsoft software including Classic Windows applications based on the standard control library Modern Universal Windows Platform apps like the Windows 10 Calculator Programs implemented through .NET Framework eg. Windows Forms applications Most applications provided by major development companies Automation issues Automation issues How to topics If UI Automation or the UIASpy tool is new to you, then you should read the How to topics. Examples Examples that demonstrates the features of UIASpy: Automating Notepad. Very detailed example. Automating Notepad - Windows XP Examples about Sample code creation: Automating Notepad with Sample code - step by step Automating Notepad with Sample code - all at once Chrome - Clicking an extension. Compact summary example. Click Save As... issue in Notepad examples: Using Expand() instead of Invoke() Updates Windows 8, Windows 8.1 and Windows 10 updates Threads UI Automation UDFs contains all include files. In Using UI Automation Code in AutoIt you can find and download examples and read information about using UIA code. UI Automation Events is about implementing event handlers and includes GUIs to detect events. IUIAutomation MS framework automate chrome, FF, IE, .... created by junkew August 2013 is the first AutoIt thread on UIA code. Zip-file The zip contains source files for UIASpy GUI. Note that UI Automation UDFs must be installed in the Includes folder. You need AutoIt 3.3.12 or later. Tested on Windows XP, Windows 7 and Windows 10. Comments are welcome. Let me know if there are any issues. UIASpy.7z1 point
-
Slipk, Glad I could help. M231 point
-
Slipk, Read what I said and run the example I mentioned. You create a context menu for the whole ListView and then the UDF will tell you which item was clicked so you can do whatever is necessary. M231 point
-
Slipk, Why are you creating the same menu for each item? For a start you are constantly overwriting the same variable with the new ControlIDs, which means that you will only ever get the menu to work. Just apply the context menu to the whole ListView and use _GUIListViewEx_ContextPos to determine which item was last right-clicked. Example 6 in the UDF zip shows you how to do it. M231 point
-
How do i can click on a chrome extension using autoit? - (Moved)
Earthshine reacted to LarsJ for a topic
See this example1 point -
Slipk, if you use my GUIListViewEx UDF (as I have already suggested) you will find the _GUIListViewEx_Save/LoadListView functions which do exactly as you wish. M231 point
-
Guiness wrote a similar function a while back:1 point
-
StringstripWS, used with the $STR_STRIPSPACES (4) flag, strips double (or more) spaces between words (leaving just only one in place of the 2 or more whitespaces). Now, since @crlf are actually considered as 2 whitespaces, the function it leaves just one of them. So the single space (@cr) left by the function is correct. It consider @cr @lf.. and all the other "white spaces" as if that are normal spaces chr(32)...1 point
-
Try this code: #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.15.0 (Beta) Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <GuiListView.au3> #include <Array.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 615, 437, 192, 124) $ListView1 = GUICtrlCreateListView("one|two|three", 104, 30, 433, 193) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 100) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 100) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 100) For $i = 0 To 50 Step 1 _GUICtrlListView_AddItem ( $ListView1, $i ) _GUICtrlListView_AddSubItem ( $ListView1, $i, "sdfdsfsdf", 1 ) _GUICtrlListView_AddSubItem ( $ListView1, $i, "jjklllllhgdfgfdzgsgsgsgs", 2 ) Next $Button1 = GUICtrlCreateButton("Click me", 224, 352, 97, 41) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $columns = _GUICtrlListView_GetColumnCount ( $ListView1 ) $allitems = _GUICtrlListView_GetItemCount ( $ListView1 ) $file = FileOpen ( @DesktopDir & "\listviewtext.txt", 2 ) For $i = 0 To $allitems - 1 Step 1 $text = _GUICtrlListView_GetItemTextArray ( $ListView1, $i ) $string = "" For $t = 1 To $text[0] Step 1 $string = $string & $text[$t] & "|" Next FileWriteLine ( $file, StringTrimRight ( $string, 1 ) ) Next FileClose ( $file ) EndSwitch WEnd1 point
-
Here a simple way that will work ALL the time, but you wont like it tho. : #include <Constants.au3> #include <Array.au3> Opt ("MustDeclareVars", 1) Global Const $FF = '7.1,00000776KN,320639,US,1/5/2019,XXXXXXXXXX,E,,,USD,26694.26,12/20/2018,,XXXXXXXXXXXXX,,4410628,82576404,F/C,1,0,XXXXXXXXXXXXXXXXXX,XXXXXXXX,XXXXXXXXX,,,,0.9,L,1,L,PKG,,,4,SHP,FC,,,,,,,,FRT,3,XXXXXXXX XXXXXX XXXXX,1,,0,,USD,1.29,7.3,,0,0,,0,0,0,0,0,1/16/2019,,,,XXXXXX XXXXXXXXX,"Hu-Frie Mfg. Co., LLC",7 E TOUCHY AVE,,Des Plaines,IL,60018,US,.,"SAPPS,DAVID T., DDS, PC",SAPPS ORTHODONTICS,189 STEWART LANE,JONESBORO,TN,28199,US,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,,0,,,,,0,,0,0,,,0,,,,,,,,,,,,0,,,,,,,0,0,0,0,0,0,,,0,0,0,,,,,,2,,,,,,0,0,0,0,0,0,0,,,,,0,,,0,,0,,,,,,,,,,,,,,,,,,,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,XXXXXXXXXXXXXXX' Global Const $rep = " | " Global $arr = StringSplit ($FF,""), $Start = False, $Final = "" For $i = 1 to $arr[0] if $arr[$i] = '"' Then $Start = not $Start if $arr[$i] = ',' and $Start then $arr[$i] = $rep $Final &= $arr[$i] Next Local $test = _ArrayToString ($arr, "", 1) MsgBox ($MB_SYSTEMMODAL,"",$test = $Final) Edit :1 point