Jump to content

Search the Community

Showing results for tags 'Click'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

  1. Hi Here is a UDF which has the much requested hotkeys for mouse clicks. Autoit's hotkeyset doesn't support mouse clicks. one of the main differences with AHK (i think). ; This UDF extends AutoIT HotKeySet by adding the much requested Mouse Button Clicks ; HotKeySet (autoIT) only does KEYBOARD ; HotKeySetEx Does both KEYBOARD and MOUSE! simple interface HotKeySetEx("{RCLICK}", "myfun") ; Right Click mouse hot key HotKeySetEx("{RDCLICK}", "myfun") ; Right double click mouse hot key HotKeySetEx("{F1}", "myfun") ; normal hot key ; new function call replaces @HotKeyPressed ; getLastHotKey() = eg {RCLICK} or {F1} See MouseTrapEvent for supported events. ; single clicks ; LClick - left button click (Primary) ; MClick - middle button click (Wheel click) ; RClick - right button click (Secondary) ; XClick1 - Xtra button 1 click (usually 'back navigaton') ; XClick2 - Xtra button 2 click (usually 'forward navigaton') ; double clicks ; LDClick - left button (Primary) ; MDClick - middle button (Wheel click) ; RDClick - right button (Secondary) ; XDClick1 - Xtra button 1 (usually 'back navigaton') ; XDClick2 - Xtra button 2 (usually 'forward navigaton') ; psuedo double clicks ('chords') - ; XClick12 - Xtra button 1&2 pressed at the same time. ; ; OTHER EVENTS you'll have to work out yourself eg mouse wheel scroll - see code. This UDF is based on MouseTrapEvent which is based on MouseSetEvent. New events for scroll and drag could be added see MouseTrapEvent code. enjoy Version two fixed left and middle double, click. Note there is a bug if you set a double click, you should set a single click as it get blocked (my apols). HotKeySetExV2.zip HotKeySetEx.zip
  2. If you don't want the standard drop-down menu's from the top menu bar, here's a simple way to catch user clicks there, so you end up with a top button bar instead, without defining actual buttons. No handling is provided other than item ID written to console. Took me about a full day of forum grazing to cobble it together. ; edited Helpfile example script for _GUICtrlMenu_CreateMenu #include <GUIConstantsEx.au3> #include <GuiMenu.au3> #include <WinAPIConv.au3> #include <WindowsConstants.au3> Example() Func Example() Local $hGUI, $hFile, $hEdit, $hHelp, $hMain ; Create GUI $hGUI = GUICreate("Menu", 400, 300) ; Create menu items $hFile = _GUICtrlMenu_CreateMenu() $hEdit = _GUICtrlMenu_CreateMenu() $hHelp = _GUICtrlMenu_CreateMenu() ; Create Main menu $hMain = _GUICtrlMenu_CreateMenu() _GUICtrlMenu_InsertMenuItem($hMain, 0, "&File", 0, $hFile) _GUICtrlMenu_InsertMenuItem($hMain, 1, "&Edit", 0, $hEdit) _GUICtrlMenu_InsertMenuItem($hMain, 2, "&Help", 0, $hHelp) ; Set window menu _GUICtrlMenu_SetMenu($hGUI, $hMain) ; Create memo control $g_idMemo = GUICtrlCreateEdit("", 2, 2, 396, 276, 0) GUICtrlSetFont($g_idMemo, 9, 400, 0, "Courier New") GUISetState(@SW_SHOW) ; ADDED LINES <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< GUIRegisterMsg( $WM_MENUSELECT, "WM_MENUSELECT_Events") GUIRegisterMsg( $WM_ENTERMENULOOP, "WM_ENTERMENULOOP" ) Global $hGuiHandle=WinGetHandle("","") ; get GUI handle too ; Loop until the user exits. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE EndFunc ;==>Example ;========================================================================== ; ADDED Func WM_MENUSELECT_Events($hWndGUI, $MsgID, $wParam, $lParam) Static $first=False $first=Not $first ; to filter out the dummy click that resets detection Local $index = _LoWord($wParam) Local $flags = _HiWord($wParam) If $first And BitAND($flags, $MF_MOUSESELECT) Then ConsoleWrite("top menu ID: " & $index & @CRLF) Return $GUI_RUNDEFMSG EndFunc Func _HiWord($x) Return BitShift($x, 16) EndFunc Func _LoWord($x) Return BitAND($x, 0xFFFF) EndFunc Func WM_ENTERMENULOOP( $hWnd, $iMsg, $iwParam, $ilParam ) ControlClick($hGuiHandle, "", "") ; dummy click at menu item 0 to reset detection Return $GUI_RUNDEFMSG EndFunc
  3. 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.
  4. Hello! I am making a GUI on autoit, I would like the button to change color when selected from default to red. I have searched the forums and haven't really found what I am looking for. Any suggestions would be appreciated. Here is my code thus far. #include "utils.au3" ;Setting Constants Global $screenHeight=@DesktopHeight Global $screenWidth=@DesktopWidth Global $expectedScore=0 Global $errors=0 Global $type Global $user Global $pwd Global $program Global $exam Global $platform Global $passScore Global $activity ;Can/Will Change these values later Global $wordRecognitionIntensity=99 Global $tutorialquestions=4 Global $actualquestions=50 Global $SecondsUntilQuestionTimesOut=20 Global $gridSearchIntensity=30 Global $topScreenCutOff=1 Local $failedQuestions="" ;Starts GUI that asks for login information, exam to take, etc.. $allowInput= True StartGUI() $allowInput= False Func StartGUI() ;========================GUI Items=========================; $hGUI = GUICreate("Auto Tester", 601, 436, 433, 170) GUISetBkColor(0xFFFFFF) $certiportLogo = GUICtrlCreatePic("C:\Users\UKELLKI\Dropbox\AutoIt\Images\certiport.jpg", 0, 0, 600, 75, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) $portalButton = GUICtrlCreateButton("Portal", 24, 120, 115, 25, $WS_GROUP) GUICtrlSetFont(-1, 10, 400, 0, "Georgia") GUICtrlSetCursor (-1, 0) GUICtrlSetColor($portalButton, 0xfffafa) GUICtrlSetBkColor(-1, 0x808080) $lmsButton = GUICtrlCreateButton("LMS", 168, 120, 115, 25, $WS_GROUP) GUICtrlSetFont(-1, 10, 400, 0, "Georgia") GUICtrlSetCursor (-1, 0) GUICtrlSetColor($lmsButton, 0xfffafa) GUICtrlSetBkColor(-1, 0x808080) $consoleButton = GUICtrlCreateButton("Console", 312, 120, 115, 25, $WS_GROUP) GUICtrlSetFont(-1, 10, 400, 0, "Georgia") GUICtrlSetCursor (-1, 0) GUICtrlSetColor($consoleButton, 0xfffafa) GUICtrlSetBkColor(-1, 0x808080) $launcherButton = GUICtrlCreateButton("Exam Launcher", 456, 120, 115, 25, $WS_GROUP) GUICtrlSetFont(-1, 10, 400, 0, "Georgia") GUICtrlSetCursor (-1, 0) GUICtrlSetColor($launcherButton, 0xfffafa) GUICtrlSetBkColor(-1, 0x808080) $serviceLabel = GUICtrlCreateLabel("Select Service", 376, 64, 152, 29) GUICtrlSetFont(-1, 16, 800, 0, "Georgia") $exitButton = GUICtrlCreateButton("Exit", 456, 376, 115, 30, $WS_GROUP) GUICtrlSetFont(-1, 14, 400, 0, "Georgia") GUICtrlSetCursor (-1, 0) GUICtrlSetColor($exitButton, 0xfffafa) GUICtrlSetBkColor(-1, 0x000000) ;=======================Hidden Items=======================; $userLabel = GUICtrlCreateLabel("User Name", 376, 192, 94, 22) GUICtrlSetFont(-1, 12, 800, 0, "Georgia") $passwordLabel = GUICtrlCreateLabel("Password", 376, 264, 83, 22) GUICtrlSetFont(-1, 12, 800, 0, "Georgia") $iuser = GUICtrlCreateInput("", 376, 232, 193, 21) $ipassword = GUICtrlCreateInput("123456", 376, 304, 193, 21, 0x0020) $runLabel = GUICtrlCreateLabel("Run On", 24, 168, 66, 22) GUICtrlSetFont(-1, 12, 800, 0, "Georgia") $programLabel = GUICtrlCreateLabel("Program", 24, 232, 76, 22) GUICtrlSetFont(-1, 12, 800, 0, "Georgia") $courseLabel = GUICtrlCreateLabel("Course ID", 24, 232, 100, 22) GUICtrlSetFont(-1, 12, 800, 0, "Georgia") $courseInput = GUICtrlCreateInput("", 24, 264, 257, 25) $scoringLabel = GUICtrlCreateLabel("Scoring Pass", 24, 296, 108, 22) GUICtrlSetFont(-1, 12, 800, 0, "Georgia") $typeSelect = GUICtrlCreateCombo("", 24, 200, 257, 25) GUICtrlSetData($typeSelect, "Staging|Test|Prod", "Staging") $programSelect = GUICtrlCreateCombo("", 24, 264, 257, 25) GUICtrlSetData($programSelect, "Internet and Computing Core Certification|Adobe Certified Associate|Autodesk Certified User|Certiport Training|CompTIA Strata|HP Accredited Technical Associate|Intuit QuickBooks|Microsoft Certified Educator|Microsoft Office Specialist|Microsoft Technology Associate", "Internet and Computing Core Certification") $scoreSelect = GUICtrlCreateCombo("", 24, 328, 257, 25) GUICtrlSetData($scoreSelect, "Smoke Test|1000 Pass|Barely Pass|Barely Fail", "Smoke Test") $iContinue = GUICtrlCreateButton("Continue", 24, 376, 115, 30, $WS_GROUP) GUICtrlSetFont(-1, 14, 400, 0, "Georgia") GUICtrlSetCursor (-1, 0) GUICtrlSetColor($iContinue, 0xfffafa) GUICtrlSetBkColor(-1, 0x000000) $browserLabel = GUICtrlCreateLabel("Select Browser", 24, 168, 125, 22) GUICtrlSetFont(-1, 12, 800, 0, "Georgia") $browserCombo = GUICtrlCreateCombo("", 24, 200, 257, 25) GUICtrlSetData($browserCombo, "Internet Explorer|Mozilla Firefox|Google Chrome|Safari", "Internet Explorer") $activityLabel = GUICtrlCreateLabel("Select Activity", 24, 168, 126, 22) GUICtrlSetFont(-1, 12, 800, 0, "Georgia") $activityCombo = GUICtrlCreateCombo("", 24, 200, 257, 25) GUICtrlSetData($activityCombo, "Study|Practice|Certify", "Study") ;=======================Hiding Items=======================; GUICtrlSetState($userLabel, $GUI_HIDE) GUICtrlSetState($passwordLabel, $GUI_HIDE) GUICtrlSetState($iuser, $GUI_HIDE) GUICtrlSetState($ipassword, $GUI_HIDE) GUICtrlSetState($runLabel, $GUI_HIDE) GUICtrlSetState($programLabel, $GUI_HIDE) GUICtrlSetState($scoringLabel, $GUI_HIDE) GUICtrlSetState($typeSelect, $GUI_HIDE) GUICtrlSetState($programSelect, $GUI_HIDE) GUICtrlSetState($scoreSelect, $GUI_HIDE) GUICtrlSetState($iContinue, $GUI_HIDE) GUICtrlSetState($browserLabel, $GUI_HIDE) GUICtrlSetState($browserCombo, $GUI_HIDE) GUICtrlSetState($activityLabel, $GUI_HIDE) GUICtrlSetState($activityCombo, $GUI_HIDE) GUICtrlSetState($courseLabel, $GUI_HIDE) GUICtrlSetState($courseInput, $GUI_HIDE) ;================End of GUI Items/Hidden Items================; GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $exitButton Exit Case $portalButton ;This ensures that the fields change when clicking different browser service GUICtrlSetState($userLabel, $GUI_HIDE) GUICtrlSetState($passwordLabel, $GUI_HIDE) GUICtrlSetState($iuser, $GUI_HIDE) GUICtrlSetState($ipassword, $GUI_HIDE) GUICtrlSetState($runLabel, $GUI_HIDE) GUICtrlSetState($programLabel, $GUI_HIDE) GUICtrlSetState($scoringLabel, $GUI_HIDE) GUICtrlSetState($typeSelect, $GUI_HIDE) GUICtrlSetState($programSelect, $GUI_HIDE) GUICtrlSetState($scoreSelect, $GUI_HIDE) GUICtrlSetState($iContinue, $GUI_HIDE) GUICtrlSetState($browserLabel, $GUI_HIDE) GUICtrlSetState($browserCombo, $GUI_HIDE) GUICtrlSetState($activityLabel, $GUI_HIDE) GUICtrlSetState($activityCombo, $GUI_HIDE) GUICtrlSetState($courseLabel, $GUI_HIDE) GUICtrlSetState($courseInput, $GUI_HIDE) ;Clearing the data in the user and password fields GUICtrlSetState($iuser, "") ;Clears password data, automatically set to 123456 *will need to be changed!* ;GUICtrlSetData($ipassword, ""); will need to decomment when launched ;End Reset Function GUICtrlSetState($userLabel, $GUI_SHOW) GUICtrlSetState($passwordLabel, $GUI_SHOW) GUICtrlSetState($iuser, $GUI_SHOW) GUICtrlSetState($ipassword, $GUI_SHOW) GUICtrlSetState($scoringLabel, $GUI_SHOW) GUICtrlSetState($scoreSelect, $GUI_SHOW) GUICtrlSetState($programLabel, $GUI_SHOW) GUICtrlSetState($programSelect, $GUI_SHOW) GUICtrlSetState($runLabel, $GUI_SHOW) GUICtrlSetState($typeSelect, $GUI_SHOW) GUICtrlSetState($iContinue, $GUI_SHOW) Case $lmsButton ;This ensures that the fields change when clicking different browser service GUICtrlSetState($userLabel, $GUI_HIDE) GUICtrlSetState($passwordLabel, $GUI_HIDE) GUICtrlSetState($iuser, $GUI_HIDE) GUICtrlSetState($ipassword, $GUI_HIDE) GUICtrlSetState($runLabel, $GUI_HIDE) GUICtrlSetState($programLabel, $GUI_HIDE) GUICtrlSetState($scoringLabel, $GUI_HIDE) GUICtrlSetState($typeSelect, $GUI_HIDE) GUICtrlSetState($programSelect, $GUI_HIDE) GUICtrlSetState($scoreSelect, $GUI_HIDE) GUICtrlSetState($iContinue, $GUI_HIDE) GUICtrlSetState($browserLabel, $GUI_HIDE) GUICtrlSetState($browserCombo, $GUI_HIDE) GUICtrlSetState($activityLabel, $GUI_HIDE) GUICtrlSetState($activityCombo, $GUI_HIDE) GUICtrlSetState($courseLabel, $GUI_HIDE) GUICtrlSetState($courseInput, $GUI_HIDE) ;Clearing the data in the user and password fields GUICtrlSetState($iuser, "") ;Clears password data, automatically set to 123456 *will need to be changed!* ;GUICtrlSetState($ipassword, ""); will need to decomment when launched ;End Reset Function GUICtrlSetState($userLabel, $GUI_SHOW) GUICtrlSetState($passwordLabel, $GUI_SHOW) GUICtrlSetState($iuser, $GUI_SHOW) GUICtrlSetState($ipassword, $GUI_SHOW) GUICtrlSetState($scoringLabel, $GUI_SHOW) GUICtrlSetState($scoreSelect, $GUI_SHOW) GUICtrlSetState($browserLabel, $GUI_SHOW) GUICtrlSetState($browserCombo, $GUI_SHOW) GUICtrlSetState($iContinue, $GUI_SHOW) Case $consoleButton ;This ensures that the fields change when clicking different browser service GUICtrlSetState($userLabel, $GUI_HIDE) GUICtrlSetState($passwordLabel, $GUI_HIDE) GUICtrlSetState($iuser, $GUI_HIDE) GUICtrlSetState($ipassword, $GUI_HIDE) GUICtrlSetState($runLabel, $GUI_HIDE) GUICtrlSetState($programLabel, $GUI_HIDE) GUICtrlSetState($scoringLabel, $GUI_HIDE) GUICtrlSetState($typeSelect, $GUI_HIDE) GUICtrlSetState($programSelect, $GUI_HIDE) GUICtrlSetState($scoreSelect, $GUI_HIDE) GUICtrlSetState($iContinue, $GUI_HIDE) GUICtrlSetState($browserLabel, $GUI_HIDE) GUICtrlSetState($browserCombo, $GUI_HIDE) GUICtrlSetState($activityLabel, $GUI_HIDE) GUICtrlSetState($activityCombo, $GUI_HIDE) GUICtrlSetState($courseLabel, $GUI_HIDE) GUICtrlSetState($courseInput, $GUI_HIDE) ;Clearing the data in the user and password fields GUICtrlSetState($iuser, "") ;Clears password data, automatically set to 123456 *will need to be changed!* ;GUICtrlSetState($ipassword, ""); will need to decomment when launched ;End Reset Function GUICtrlSetState($userLabel, $GUI_SHOW) GUICtrlSetState($passwordLabel, $GUI_SHOW) GUICtrlSetState($iuser, $GUI_SHOW) GUICtrlSetState($ipassword, $GUI_SHOW) GUICtrlSetState($scoringLabel, $GUI_SHOW) GUICtrlSetState($scoreSelect, $GUI_SHOW) GUICtrlSetState($activityLabel, $GUI_SHOW) GUICtrlSetState($activityCombo, $GUI_SHOW) GUICtrlSetState($iContinue, $GUI_SHOW) Case $launcherButton ;This ensures that the fields change when clicking different browser service GUICtrlSetState($userLabel, $GUI_HIDE) GUICtrlSetState($passwordLabel, $GUI_HIDE) GUICtrlSetState($iuser, $GUI_HIDE) GUICtrlSetState($ipassword, $GUI_HIDE) GUICtrlSetState($runLabel, $GUI_HIDE) GUICtrlSetState($programLabel, $GUI_HIDE) GUICtrlSetState($scoringLabel, $GUI_HIDE) GUICtrlSetState($typeSelect, $GUI_HIDE) GUICtrlSetState($programSelect, $GUI_HIDE) GUICtrlSetState($scoreSelect, $GUI_HIDE) GUICtrlSetState($iContinue, $GUI_HIDE) GUICtrlSetState($browserLabel, $GUI_HIDE) GUICtrlSetState($browserCombo, $GUI_HIDE) GUICtrlSetState($activityLabel, $GUI_HIDE) GUICtrlSetState($activityCombo, $GUI_HIDE) GUICtrlSetState($courseLabel, $GUI_HIDE) GUICtrlSetState($courseInput, $GUI_HIDE) ;Clearing the data in the user and password fields GUICtrlSetState($iuser, "") ;Clears password data, automatically set to 123456 *will need to be changed!* ;GUICtrlSetState($ipassword, ""); will need to decomment when launched ;End Reset Function GUICtrlSetState($userLabel, $GUI_SHOW) GUICtrlSetState($passwordLabel, $GUI_SHOW) GUICtrlSetState($iuser, $GUI_SHOW) GUICtrlSetState($ipassword, $GUI_SHOW) GUICtrlSetState($scoringLabel, $GUI_SHOW) GUICtrlSetState($scoreSelect, $GUI_SHOW) GUICtrlSetState($iContinue, $GUI_SHOW) GUICtrlSetState($browserLabel, $GUI_SHOW) GUICtrlSetState($browserCombo, $GUI_SHOW) GUICtrlSetState($courseLabel, $GUI_SHOW) GUICtrlSetState($courseInput, $GUI_SHOW) Case $iContinue ;Makes all of the information from GUI available $type=GUICtrlRead($typeSelect) $user=GUICtrlRead($iuser) $pwd=GUICtrlRead($ipassword) $program=GUICtrlRead($programSelect) $passScore=GUICtrlRead($scoreSelect) $activity=GUICtrlRead($activityCombo) $exam="selectLater" ExitLoop EndSwitch WEnd GUIDelete($hGUI) ;delete the file so it can be rewritten and set error log to 0 FileDelete ( "result.log.txt" ) DirRemove ("C:\TEMP",1) DirCreate ("C:\TEMP") _BlockInputEx(1, "{Pause}") if $program="Adobe Certified Associate" then $topScreenCutOff=5 endif ;loads the test up from the correct platform and browser if $platform="Portal Internet Explorer" then _callIE() ElseIf $platform="Portal Chrome" then _PortalBrowser("chrome.exe") ElseIf $platform="Portal Firefox" then _PortalBrowser("firefox.exe") ElseIf $platform="Portal Safari" Then _PortalBrowser("safari.exe") ElseIf $platform="Console" then _CallConsole() EndIf LockdownNav() EndFunc
  5. 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
  6. Hey there! 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!
  7. Greetings! I am in need of your guidance once again. I searched the forums for clicking in span, clicking by class, clicking without an ID or Name, etc., but I am unable to find a solution for my problem. I am trying to expand this tree in IE. There is an arrow ( > ) that i need to click, but I can't find a way to do it . Alternatively, I can double-click the text "Servers", but that seems to be even more troublesome. I will have to do this 2-3 more times as the tree expands. There appears to be an ID for the tree, simply called "tree", but that isn't working when I send a click to it. ;Open an IE session and navigate to pgAdmin. Global $oIE = _IECreate($pgAdmin) ;Maximize the IE window. WinSetState(_IEPropertyGet($oIE, "hwnd"), "", @SW_MAXIMIZE) Sleep(2000) ;Expand the tree $oTree = _IEGetObjById($oIE, "tree") _IEAction($oTree, "click") Any ideas?
  8. Quick question: How can I click this "Select All" button in IE? There's no ID, and the href is "#" Am I looking at the wrong html code? Am I looking Thank you all in advance!
  9. <span class="fr66n"><button class="dCJp8 afkep coreSpriteHeartOpen _0mzm-"><span class="glyphsSpriteHeart__outline__24__grey_9 u-__7" aria-label="BeÄŸen"></span></button></span> I want to click this button ?
  10. Hello again, I am in phase two of my help bot. I cannot figure out how to properly code Autoit to click on a webpage button using the I.E UDF. I want to click on the button that I have attached as an image. This button does not have a name but it has an ID. Here is the HTML code for this button that I found using chromes developer inspector. HTML Code: <img role="button" tabindex="-1" id="toolactions_INSERT-tbb_image" src="nav_icon_insertkey.gif" alt="New Work Order CTRL+ALT+I" draggable="false"> Here is the code that I have so far: ;******************************************************************************* ; Opens IE and fill out a New Workorder ;******************************************************************************* ; Start IE at the ** Tracking Application in ****** $oIE = _IECreate("https:I_am_Bound_by_my_company_to_not_reveal_this_webpage") ; Wait for a browser page load to complete _IELoadWait($oIE) Sleep(6000) ; Store the field names where the important data will be sent Local $nWorkOrderB = _IEGetObjById($oIE, "toolactions_INSERT-tbb_image") _IEAction($nWorkOrderB, "click") I want my program to click on the button that looks like a piece of paper with a blue # (For those wondering, I am allowed to send images just not the URL.) As always any help would be appreciated.
  11. Hello Everyone, New Guy here. This is a two-part question, hopefully easy enough though. I know it's ugly coding, this is because I have only a couple hours worth of coding experience and could really use some help. 1) When I single click the button I want one action (like playing a sound clip) and when I double click the button I want a different action (such as opening dialogue box to ask for soundclip directory address). At the bottom of the script I made a comment which one I would like single click versus double click. 2) I can not get the FileOpenDialogue to save the file address to the config.ini file at the 'One' position on the .ini. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> #include <FileConstants.au3> #include <AutoItConstants.au3> #include <Sound.au3> Opt('MustDeclareVars', 1) Opt("GUIOnEventMode", 1) Global $OneID _Main() Func _Main() GUICreate("Form1", 156, 86, 281, 276) $OneID = GUICtrlCreateButton("Button", 15, 17, 122, 37) GUICtrlSetOnEvent($OneID, "OnOne") GUISetOnEvent($GUI_EVENT_CLOSE, "OnExit") GUISetState() While 1 While 1 Sleep(1000) WEnd WEnd EndFunc ;---------------Functions------------- While 1 Sleep(100) WEnd Func OnOne() ; ******************Single Click for this action**************** $OneID = IniRead("config.ini", "Config", "One", $OneID) If $OneID = True Then SoundPlay($OneID, @HotKeyPressed) Else ; *******Double Click for this action*****And Help Saving File Address to config.ini 'One'*********** $OneID = FileOpenDialog("Select file", @WorkingDir, "All (*.*)") IniWrite("config.ini", "Config", "One", $OneID) $OneID = InputBox("Enter Information", "Short Name for File?", "") IniWrite("config.ini", "Config", "NameOne", $OneID) EndIf EndFunc Any help would be greatly appreciated, and if you need anymore clarity as to what exactly I'm trying to do, please do not hesitate to ask. Thanks so much! Pike
  12. Hi! I have a button where I need to close it! I was doing through clicking same position in screen but there are some id's that have different sizes. What are the possible ways to click this closable button? Is there a way to close it through id? Is there a way to get it's position through it's ID? Thanks in advance!
  13. I'm trying to click a button on a web page. I have added a couple of MsgBox lines to allow me to watch what happens on the page. As you can see the first half of my script enters data into text boxes on the page. I have no problem there. I just cannot click on the region buttons. The "set focus" line causes an outline to appear around the EU button and the "click button" line causes the "Pick a Region" text to disappear. Here is the code I have so far. #include <IE.au3> Local $oIE = _IECreate("http://questchecker.com/") Local $iQuestID = "123456" Local $sCharacterName = "CharacterName" Local $colForms = _IEFormGetCollection($oIE) $iCount = 0 For $oForm In $colForms $oFormElements = _IEFormElementGetCollection($oForm) For $oFormElement In $oFormElements $iCount = $iCount + 1 Local $sTagName = StringLower($oFormElement.tagName) Local $sElementType = $oFormElement.type Local $sElementName = $oFormElement.name Switch $iCount Case 6 _IEFormElementSetValue($oFormElement, "MyRealm", 0) ; realm Case 7 _IEFormElementSetValue($oFormElement, $sCharacterName, 0) Case 8 _IEFormElementSetValue($oFormElement, $iQuestID, 0) EndSwitch Next Next Local $oButtons = _IEGetObjByName($oIE, "questForm") For $oButton In $oButtons If _IEFormElementGetValue($oButton) = "US" Then MsgBox(0, "", "Click Okay to set focus") _IEAction($oButton, "focus") MsgBox(0, "", "Click Okay to click button") _IEAction($oButton, "click") ExitLoop EndIf Next MsgBox(0, "", "Click Okay to quit") _IEQuit($oIE) Exit
  14. Perform a simple google search! The script below works fine until fill the google form! What I can't find is how to submit the form, tried a couple of ways and none of them worked. #include <IE.au3> $oIE = _IECreate ("www.google.com") $o_form = _IEFormGetObjByName ($oIE, "f") $o_login = _IEFormElementGetObjByName ($o_form, "q") $username = "80251369" _IEFormElementSetValue ($o_login, $username) $o_numer = _IEGetObjByName($o_form, "btnK") _IEAction ($o_numer, "click") The code runs without any problem. I don't know how to proceed! Thanks in advance!
  15. Hi all i am currently trying to click on an element in a HTML Table, but just can get it to work. i am able to click the top of the table so it changes to sort but just can't click on the element in the table. an i need to click on element to continue in the site. i have attached the code so far and pictures of the table element want to click plus the source of the table. i am able to get data in the table with $oTable = _IETableGetCollection($oIE, 2) but not able to click on them. Help is very much appreciated #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.14.2 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <IE.au3> #include "DOM.au3" #include <Array.au3> #include <MsgBoxConstants.au3> Global $oIE = _IECreate("*") _IELoadWait($oIE) Sleep(2000) _PageLogin($oIE) _PageLoadWait() _PageNewReq($oIE) _PageLoadWait() _InputModelInf($oIE) _PageLoadWait() Sleep(1000) $aTableLink = BGe_IEGetDOMObjByXPathWithAttributes($oIE, "//table/tbody/tr/td[.='Name Of user']", 2000) ;~ $aTableLink = BGe_IEGetDOMObjByXPathWithAttributes($oIE, "//table/tbody/tr", 2000) ;~ _ArrayDisplay($aTableLink,"$aTableLink") If IsArray($aTableLink) Then ConsoleWrite("Able to BGe_IEGetDOMObjByXPathWithAttributes($oIE, //table/tbody/tr/td[.='Name Of user'])" & @CRLF) For $i = 0 To UBound($aTableLink)-1 ConsoleWrite(" OuterHTML : " & $aTableLink[$i].outerHTML & @CRLF) ConsoleWrite(" Parentnode : " & $aTableLink[$i].parentnode & @CRLF) ConsoleWrite(" Parentnode.click : " & $aTableLink[$i].parentnode.fireEvent("onclick","click") & @CRLF) $objClick = $aTableLink[$i].parentnode ;~ _IEAction($aTableLink[$i] , "focus") _IEAction($objClick , "focus") ;~ If _IEAction($aTableLink[$i], "click") Then If _IEAction($objClick, "click") Then ConsoleWrite("Able to _IEAction($aForumLink[0], 'click')" & @CRLF) _IELoadWait($oIE) Else ConsoleWrite("UNable to _IEAction($aForumLink[0], 'click')" & @CRLF) Exit 3 EndIf Next Else ConsoleWrite("Unable to BGe_IEGetDOMObjByXPathWithAttributes($oIE, //table/tbody/tr/td[.='Name Of user'])" & @CRLF) Exit 2 EndIf _PageLoadWait() Func _InputModelInf($oTmpIE) ; Add Var for Model & Serial in Func $oModelInput = _IEGetObjById($oTmpIE,"model") _IEAction($oModelInput,"focus") _IEDocInsertText($oModelInput, "*") $oSerialInput = _IEGetObjById($oTmpIE,"serial") _IEAction($oModelInput,"focus") _IEDocInsertText($oSerialInput, "*") $links = $oTmpIE.document.getElementsByClassName("btn btn-primary ng-scope") For $link In $links If $link.innertext = "Søg" Or $link.innertext = "Search" Then $link.click() ExitLoop EndIf Next Return True EndFunc Func _PageNewReq($oTmpIE) $links = $oTmpIE.document.getElementsByClassName("ng-scope k-link") For $link In $links If $link.innertext = "Send ny fejlmelding" Or $link.innertext = "Submit a New Service Request" Then $link.click() ExitLoop EndIf Next Return True EndFunc Func _PageLogin($oTmpIE) $oUserInput = _IEGetObjById($oTmpIE,"loginid") _IEDocInsertText($oUserInput, "*") $oPasswordInput = _IEGetObjById($oTmpIE,"password") _IEDocInsertText($oPasswordInput, "*") $links = $oTmpIE.document.getElementsByClassName("btn btn-primary login ng-scope") For $link In $links If $link.innertext = "Sign in" Then $link.click() ExitLoop EndIf Next Return True EndFunc Func _PageLoadWait() Local $PageLoadWait = False ;~ nav navbar-nav navbar-right ng-hide ;~ nav navbar-nav navbar-right $tags = $oIE.document.GetElementsByTagName("ul") For $tag in $tags $class_value = $tag.GetAttribute("class") If $class_value = "nav navbar-nav navbar-right" Then ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : Webpage loading :) ' & @CRLF) ;### Debug Console $PageLoadWait = True ExitLoop EndIf Next Do sleep(250) For $tag in $tags $class_value = $tag.GetAttribute("class") If $class_value = "nav navbar-nav navbar-right ng-hide" Then ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : Webpage load finished :)'& @CRLF) ;### Debug Console $PageLoadWait = False ExitLoop EndIf Next Until $PageLoadWait = False EndFunc Thanks in advance
  16. Hello dear community, definitely I need external help now. I've did all 'ControlClick() - Tutorials' and read a lot of topics about interaction betweend AutoIT and external programs. The most of them are about "Clicking a button ...". In my case it's different because I need to click a specific element within the program. The 'program' what I am talking about is called Mendeley. It's library software for documents administration. In the attachements in picture '1.jpg' you can see the red marked Help element. In the picture '2.jpg' you see the context menu of the Help element. This is what I'm trying to do with the ControlClick() function. Following I represent my code which not worked for me: #include <MsgBoxConstants.au3> Opt("WinTitleMatchMode", 2) $hWnd = WinGetHandle("Mendeley Desktop", "") MsgBox($MB_SYSTEMMODAL, "handle check", $hWnd) ControlClick($hWnd, "Mendeley Desktop", "Help") The MsgBox tells me the number of the handle of the Mendeley window. It's not 0 so for me it means the window is recognized correctly. When I'm execute the script the Help element is not clicked. Any suggestions for me? Kind regards OtenMoten
  17. I need to click on the text "Batch submission" but I can not! <div class="batchmenu2" onclick="Go('/lot/')" style="background-color: rgb(255, 255, 255);"> <span class="iconep">l</span> <div class="menu"> <b>Batch submission</b> <br> Bulk messages via file </div> </div> How could I do it? How can I click the specific OnClick?
  18. <input name="VsMasterPage$MainContent$LoginUserControl$LoginForm$FormsAuthLoginContainer$LoginButton$InternalButton" class="Button" id="VsMasterPage_MainContent_LoginUserControl_LoginForm_FormsAuthLoginContainer_LoginButton_InternalButton" onclick='javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("VsMasterPage$MainContent$LoginUserControl$LoginForm$FormsAuthLoginContainer$LoginButton$InternalButton", "", true, "Login", "", false, false))' type="submit" value="Sign In"> I am trying to click the sign in button on this page. I have tried by class, text, etc Here was my last attempt $oButtons = _IETagNameAllGetCollection($o_IE, "button") For $oButton in $oButtons If String($oButton.value) = "Sign In" Then Sleep (1000) _IEAction($oButton, "click") ExitLoop EndIf Next This did not work either.
  19. Go create a quick account in Zapier and go to https://zapier.com/app/dashboard and make some Zaps! Just need to click the specific instance of an .open-menu button and then click its a.run (anchor) element. Doing this IE.au3 script just causing to click its container element: $target = 1; Target the first instance #include <IE.au3> $oIE = _IEAttach("Dashboard - Zapier") $count = 0; $tags = _IETagNameGetCollection($oIE, "div") For $tag in $tags $class_value = $tag.GetAttribute("class") If $class_value = "open-menu" Then $count += 1 if $count = $target Then MsgBox(0, "Instance: ", $count) ; $tag.fireEvent("onmousedown") ; _IEAction($tag, "click") ; $tag.fireEvent("onmouseup") ; Or this but not working ; $tag.Click EndIf EndIf Next I also tried to do it using FF.au3 $target = 1; Target the first instance #Include <Array.au3> #Include <FF.au3> $count = 0; If _FFConnect(Default, Default, 3000) Then $aArray = _FFXPath( "//div[@class='open-menu']", "", 7 ) ; _ArrayDisplay($aArray) For $tag in $aArray $count += 1 if $count = $target Then MsgBox(0, "Instance: ", $count) _FFClick($tag) EndIf Next EndIf Error: _FFClick ==> No match: $sElement: [number] Could some help me how to click such buttons on such kind of a dynamic page?
  20. Hi everybody, I have troubles using the function "GUISetCursor" properly. My script generates a small GUI and opens an image in IrfanView. If the user hits the button "$p_coord" on the GUI, the GUI shall be hidden, IrfanView shall become active and the mousepointer shall turn into a cross (as long hovering over IrfanView). Once clicked into IrfanView, the cursor shall turn into a nordinary mousepointer again. Unfortunately, the cross doesn't appear until the user clicks into IrfanView manually. Then the mousepointer changes for the duration of the click into the cross. Can anybody tell why this is happening? Here is the relevant code: GUISetState(@SW_SHOW, $hGUI) ;the autoit gui is hidden ; Loop until the user exits: While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $p_coord WinSetState("Bicon Coordinator","",@SW_HIDE) ;the autoit gui is hidden $Handle = WinActivate ( "IrfanView") ; IrfanView is activated GUISetCursor (15,1,$Handle) ;Cursor should be turned into a cross - this is what fails :-( While 1 If _IsPressed ("01", $hDLL) Then ;Once a mousclick by the user is performed... GUISetCursor (2) EndIf EndSwitch WEnd dejhost
  21. Hi guys, Trying to map my mouse button 4 (I'm pretty sure it's 4 rather than 5, but I can experiment) to click the back button in a program (screenshot attached). In terms of positioning it sits in the middle of 3 screens if that makes a difference. I assume I can use something like (though I prob don't need the 1st two lines if using ControlClick?): WinActivate("ConnectWise v2016.4 (41139)", "Chrome Legacy Window") WinWaitActive("ConnectWise v2016.4 (41139)", "Chrome Legacy Window") ControlClick("ConnectWise v2016.4 (41139)", "Chrome Legacy Window", "[CLASS:Chrome_RenderWidgetHostHWND; INSTANCE:1]", "Left", 1, 0, 30) When I hover my mouse over the button I get the following information in Window Info >>>> Window <<<< Title: ConnectWise v2016.4 (41139) Class: TabBrowser_MainFrame Position: -8, -8 Size: 1696, 1026 Style: 0x17CF0000 ExStyle: 0x00040100 Handle: 0x0000000000010C56 >>>> Control <<<< Class: Chrome_RenderWidgetHostHWND Instance: 1 ClassnameNN: Chrome_RenderWidgetHostHWND1 Name: Advanced (Class): [CLASS:Chrome_RenderWidgetHostHWND; INSTANCE:1] ID: 315622768 Text: Chrome Legacy Window Position: 0, 30 Size: 1680, 957 ControlClick Coords: 81, 138 Style: 0x56300000 ExStyle: 0x00000020 Handle: 0x0000000000040AC6 >>>> Mouse <<<< Position: 81, 191 Cursor ID: 0 Color: 0x004E7F >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< ConnectWise: My Calendar Chrome Legacy Window >>>> Hidden Text <<<< Chrome Legacy Window
  22. This is the info of the interface: Window Title: Password Safe Class: #32770 Control Class: ToolbarWindow32 Instance: 2 ClassnameNN: ToolbarWindow322 Name: Advanced (Class): [CLASS:ToolbarWindow32; INSTANCE:2] ToolsBar 1: 32003 Make New Database 2: 32002 Open Another Database 3: 32004 Close Database 4: 32005 Save Database 5: 0 6: 32066 Copy Password to Clipboard 7: 32068 Copy Username to Clipboard 8: 32069 Copy Notes to Clipboard 9: 32065 Clear the clipboard contents 10: 0 I wanted to click on 1: 32003 Make New Database. But unfortunately, I'm unable to click on that. Any help is much appreciated. Below are the code I tried: $Title = "Password Safe" $Class = "[CLASS:ToolbarWindow32; INSTANCE:2]" WinWaitActive($Title) Sleep(500) Dim $hWnd = WinGetHandle($Title,"") Dim $hToolBar = ControlGetHandle($hWnd, '', $Class) ConsoleWrite($hWnd & @TAB & $hToolBar & @LF) _GUICtrlToolbar_ClickIndex($hToolBar, 32003)
  23. Hi Guys, I have written a little loop program that counts to whatever you choose in "Rounds". (this is just a short version of my program, but it should cover what I try to achieve) I now want to be able to stop the counting by pressing the start/stop button. Unfortunately, autoit only registers my click on my button AFTER the func has ended. Do you guys have an idea how to stop the function? Maybe check if button was pressed in the loop? Thanks, Comboku #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <IE.au3> #include <Array.au3> #include <File.au3> $Form1 = GUICreate("Looper", 355, 229, 435, 293) $StartStop = GUICtrlCreateButton("Start", 136, 184, 75, 25) $Rounds = GUICtrlCreateInput("1", 210, 40, 80, 21) $lRounds = GUICtrlCreateLabel("Rounds", 298, 42, 52, 18) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $StartStop If GUICtrlRead($StartStop) = "Start" Then GUICtrlSetData($StartStop, "Stop") GUICtrlSetState($Rounds, $GUI_DISABLE) Call("Loop") ElseIf GUICtrlRead($StartStop) = "Stop" Then ExitLoop MsgBox(0, "Info", "Stopped") Else MsgBox(0, "Info", "Error") EndIf Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func Loop() $LoopTimes = GUICtrlRead($Rounds) For $i = 1 To $LoopTimes MsgBox(0, "Info", "LET US COUNT: " & $i) Sleep("2000") Next GUICtrlSetData($StartStop, "Start") GUICtrlSetState($StartStop, $GUI_ENABLE) GUICtrlSetState($Rounds, $GUI_ENABLE) EndFunc
  24. Hi guys! I'm really new to AutoIT, and I have little experience with scripting or any sort of programming. But I'm trying to learn! Right now, what I'm trying to do is make a quick script that repeats a few functions while a key is held down. I want to see if I can make a quick-burst script that might work in Fallout 4 with machine guns #include <Misc.au3> $dll = DllOpen("user32.dll") While 1 Sleep(100) If _IsPressed("01", $dll) Then MouseDown("left") Sleep(320) MouseUp("left") Sleep(25) EndIf WEnd DllClose($dll) Right now, when I hold down my left mouse button, it just repeats the script once - then I have to release and hold again to enable it again. Is it possible to to start it from the top and basically just repeats itself while I'm holding down my mouse button? In advance, thank you!
  25. Hi All, I'm wanting to learn how to use ControlSend or ControlClick to be able to click a button when prompted, part of the problem is the button text changes. The button I want to click displays "NO (XX)" where XX is a countdown each second from 90 - image attached. I've not done Control based code before, so the below code may be wrong lol, but this is what I've got so far: While 1 If WinExists("System", "reboot") Then Local $hWnd = WinWait("System", "reboot", 5) Local $iPID = WinGetProcess($hWnd) ControlClick($hWnd, "", "[CLASS:Button; Text: NO"] ;ProcessClose($iPID) EndIf Sleep(10000) WEnd Thanks!
×
×
  • Create New...