Recently Browsing 0 members
No registered users viewing this page.
Hi, recently i created a GUI for some calculations in AutoIT. The GUI has 2 tabs and on the first tab, it has few inputboxes where i use to click with mouse and start entering the inputs. i recently made some changes in the position of these textboxes. I made this by changing the autoit code file instead of making changes in KODA. Now i cannot click inside these textboxes with mouse. However, i can use TAB key to cycle through/enter input in these input boxes. what could have made the inputboxes not responding to mouseclicks. thanks
Hello! Thanks you for looking at my post
**No source code I'm sorry work related can't copy information**
I've been using autoit for about 1 year.
I'm having trouble automating a click on an internet explorer web page and I've tried a lot of examples from help pages and forums already. The object I'm trying to click on isnt always in the same spot so I can't use mouse click or control click, I have tried to use the different get collection options and clickbyname, or index or get object. I'm just struggling.
Description of object I'm trying to click --
HTML Code looks like <a ng-click.. "Click Here" it appears it's just a click able object named "click here" that opens a hidden window by running a script inside the web page. I'm not able to grab the information from the window unless it's open so I have to automate this click somehow.
I understand it's difficult to assist without having something to look at, I apologize for that sincerely and appreciate and assistance and suggestions.
I'm trying to write a script to allow pause / resume of Dropbox syncing; so that Dropbox syncing can be scheduled.
So the idea is that the script will emulate what a user would normally do by clicking on Dropbox on the System Tray and then the script will toggle the sync operation
If Dropbox currently syncing, will pause If syncing currently paused, will resume I'm writing this script for Windows 10
I am able to open Dropbox from the System Tray, but I can't figure out how to enumerate the controls.
I would have been happy with the "simple" approach of using the Autoit Window Info tool to manually identify the values for the control. But unfortunately as soon as I click on the Finder Tool the Dropbox window closes.
I then tried enumerating the controls with my script.
I have experimented with a couple of scripts that others have shared, which while they don't error; don't return any values for the Controls.
So at the moment I'm stuck and I'm after some ideas
Is there a way to use a Windows Viewer tool with an app like Dropbox that doesn't remain visible? (I had a quick look but could not find a solution) If I need to enumerate the controls myself, here is my current script. I'm using _EnumChildWindows from here #include <Array.au3> #include <GuiToolBar.au3> #include <_EnumChildWindows.au3> Local $hSysTray_Handle Local $hWnd="",$hControl=0,$sTitle=0,$sClass=0,$aEnumList Local $hNumber1Button=-1,$hNumber4Button=-1,$hPlusButton=-1,$hEqualButton=-1 $sSearchtext='Dropbox' $iButton=Get_SysTray_IconText($sSearchtext) _GUICtrlToolbar_ClickButton($hSysTray_Handle, $iButton, "left", False, 1) ; MsgBox (64,'Searched Button','Button: '&$iButton&@CRLF&'Instance: '&@extended) If WinActivate($hSysTray_Handle, "") Then ; MsgBox($MB_SYSTEMMODAL, "", "Dropbox Window activated") ; Check Dropbox status - Either: ; 'Up to date' (i.e. syncing) ; 'Syncing paused' (paused) $hWnd = $hSysTray_Handle ; Important to wait for the window to fully 'create' itself before getting child windows! ; Note that other processes that become activated somewhere between WinWait and this will cause WinWaitActive() to wait for manual activation ;WinWaitActive($hWnd) ; bad idea in busy environment Sleep(3000) WinActivate($hWnd) ; this seems to be a better alternative, the window seems fully created after this is called in my tests ; Parameters to function ;$hControl=HWnd(0x########) ;$sTitle="^(\d|\+|=)$" ; PCRE - gets controls with numbers, + or = sign only (problem: no instance #'s!) ;$sClass="Button" $aEnumList=_EnumChildWindows($hWnd,$hControl,$sTitle,$sClass) ;,2) for RegExp Title If @Error Then Exit ; Find specific items [Certain versions of Calc won't return any text] For $i=1 to $aEnumList Switch $aEnumList[$i] Case "1" $hNumber1Button=$aEnumList[$i] ConsoleWrite("'1' Advanced Mode Name (in current state): [CLASS:Button; INSTANCE:"&$aEnumList[$i]&"]"&@CRLF) Case "4" $hNumber4Button=$aEnumList[$i] ConsoleWrite("'4' Advanced Mode Name (in current state): [CLASS:Button; INSTANCE:"&$aEnumList[$i]&"]"&@CRLF) Case "+" $hPlusButton=$aEnumList[$i] ConsoleWrite("'+' Advanced Mode Name (in current state): [CLASS:Button; INSTANCE:"&$aEnumList[$i]&"]"&@CRLF) Case "=" $hEqualButton=$aEnumList[$i] ConsoleWrite("'=' Advanced Mode Name (in current state): [CLASS:Button; INSTANCE:"&$aEnumList[$i]&"]"&@CRLF) EndSwitch Next ; Add Headers $aEnumList="Handle" $aEnumList="Classname" $aEnumList="Control ID" $aEnumList="Iteration" $aEnumList="Title/Text" ; Bring the window forward WinActivate($hWnd) ; Perform a simple calculation to show interaction If $hNumber1Button<>-1 Then ControlClick($hWnd,"",$hNumber1Button,"primary",3) ControlClick($hWnd,"",$hNumber4Button) Sleep(1000) ControlClick($hWnd,"",$hPlusButton) Sleep(1000) ControlClick($hWnd,"",$hNumber4Button,"primary",2) ; double click, but that's fine Sleep(1000) ControlClick($hWnd,"",$hEqualButton) EndIf ; And Display ALL Enumerated Windows _ArrayDisplay($aEnumList,"Enumerated controls for App") Else MsgBox($MB_SYSTEMMODAL + $MB_ICONERROR, "Error", "Dropbox Window not activated") EndIf Func Get_SysTray_IconText($sSearch) For $i = 1 To 99 ; Find systray handles $hSysTray_Handle = ControlGetHandle('[Class:Shell_TrayWnd]', '', '[Class:ToolbarWindow32;Instance:' & $i & ']') ; ConsoleWrite ("Handle: " & $hSysTray_Handle & @CRLF) If @error Then ;MsgBox(16, "Error", "System tray not found") ExitLoop EndIf ; Get systray item count Local $iSysTray_ButCount = _GUICtrlToolbar_ButtonCount($hSysTray_Handle) ConsoleWrite("iSysTray_ButCount: " & $iSysTray_ButCount & @CRLF ) If $iSysTray_ButCount = 0 Then ;MsgBox(16, "Error", "No items found in system tray") ContinueLoop EndIf Local $aSysTray_ButtonText[$iSysTray_ButCount] ; Look for wanted tooltip For $iSysTray_ButtonNumber = 0 To $iSysTray_ButCount - 1 ConsoleWrite("iSysTray_ButtonNumber: " & $iSysTray_ButtonNumber & " Button_Text: " & _GUICtrlToolbar_GetButtonText($hSysTray_Handle, $iSysTray_ButtonNumber) & @CRLF ) If $sSearch= StringLeft(_GUICtrlToolbar_GetButtonText($hSysTray_Handle, $iSysTray_ButtonNumber),StringLen($sSearch)) Then ConsoleWrite("Button Text: " & $sSearch & " Handle: " & $hSysTray_Handle & " Button Number: " & $iSysTray_ButtonNumber & @CRLF) Return SetError(0, $i, $iSysTray_ButtonNumber) EndIf Next Next Return SetError(1, -1, -1) EndFunc ;==>Get_SysTray_IconText Thanks,
good morning all.
first lit me give you all a thinks to your help
you're help me allot thank you all.
sirs today i've a new problem
it's not a problem but thing i want to add it to blind accessability.
the ListBox can send a notification when the user send a double click on it items
but as we know that the blind users can't use the mouse for that they use the keybord to navigate.
as we know that the enter replace the double click on the keybord
for that i need when the user send a inter above any listBox item the list send a double click notification.
i know some of you tell me that i can use the GUISetAccelerators function
but the enter has a other tasks such as leav a blanc line on edits and activate the defaultButton and other tasks.
that what i need and i hope that you can help me
this is a simple example.
#include <GUIConstantsEx.au3> #include <StructureConstants.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> #include <ListBoxConstants.au3> Example() Func Example() Local $sMESSAGE = "The following buttons have been clicked" GUICreate("My GUI list") ; will create a dialog box that when displayed is centered Local $idButton_Add = GUICtrlCreateButton("Add", 64, 32, 75, 25) Local $idButton_Clear = GUICtrlCreateButton("Clear", 64, 72, 75, 25) global $idMylist = GUICtrlCreateList("buttons that have been clicked", 176, 32, 121, 97) GUICtrlSetLimit(-1, 200) ; to limit horizontal scrolling GUICtrlSetData(-1, $sMESSAGE) global $DummyList = GUICtrlCreateDummy() GUICtrlSendToDummy($DummyList, 1) Local $idButton_Close = GUICtrlCreateButton("my closing button", 64, 160, 175, 25) GUIRegisterMsg($WM_command, "WM_command") GUISetState(@SW_SHOW) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idButton_Add GUICtrlSetData($idMylist, "You clicked button No1|") Case $idButton_Clear GUICtrlSetData($idMylist, "") Case $idButton_Close MsgBox($MB_SYSTEMMODAL, "", "the closing button has been clicked", 2) Exit case $DummyList $g_iTemp = GUICtrlRead($DummyList) if $g_iTemp = $LBN_DBLCLK then ;$LBN_DBLCLK then msgBox(64, "", "") endIf GUICtrlSendToDummy($DummyList, 0) EndSwitch WEnd EndFunc ;==>Example Func WM_command($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg Local $tNMHDR = DllStructCreate($tagNMHDR, $lParam) $hWndFrom = $lParam $iCode = BitShift($wParam, 16) ; Hi Word Switch $hWndFrom Case GUICtrlGetHandle($idMylist) Switch $iCode Case $LBN_SELCHANGE, $LBN_DBLCLK, $LBN_SELCANCEL, $LBN_SETFOCUS GUICtrlSendToDummy($DummyList, $iCode) case else ;GUICtrlSendToDummy($DummyTreeview, 1) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc
I am having a problem with clicking a button in IE. As you can see in the code, there would be a class name to click it, but since this button exists several times with exactly the same code, I can only use the "Noch nicht veröffentlicht" to separate it from the others. But this part is just pure text without any classification.
"<div class="checkmark" data-v-1e5b1f70=""><svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 16 16" data-v-1e5b1f70=""><circle cx="8" cy="8" r="8" data-v-1e5b1f70="" /></svg></div>Noch nicht veröffentlicht"
I was trying to click it with:
#include <IE.au3> local $oNNVs = _IEFormGetCollection($oIE2) For $oNNV in $oNNVs If String($oNNV.innertext) = "Noch nicht veröffentlicht" Then _IEAction($oNNV, "click") EndIf Next and:
$inputs = $oIE2.document.getElementsByTagName("div") For $input In $inputs If $input.innertext == "Noch nicht veröffentlicht" then $input.click() EndIf Next But nothing seems to work. Thanks for the help!