Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. Hi, AndroidZero started another thread asking how to read the content of a clicked notification. Here is some Beta code which has this facility along with the title/message clicked functionality from the posts above: UDF: Notify_Mod_TextRet.au3 Example script: Notify_Mod_TextRet_Ex.au3 Let me know if it is of use to anyone, particularly AndroidZero! M23
  3. AndroidZero, As the question was specific to the Notify UDF, why did you not post in the UDF thread where I am more likely to see it? Anyway, if you do go to the thread, you will see I have a new Beta which should help you get what you want without fiddling in the INTERNAL_USE_ONLY functions. M23
  4. Hello. I am strugling with scite opening files. My desired behaviour is doubleclicking scripts opens it in existing scite window in new tab, (works when I set check.if.already.open=1), but I also want an option to open another scite window by doubleclicking scite directly (works when I set check.if.already.open=0). But when its 0, doubleclicking script always opens it in new window instead of in tab, and setting it to 1 dont allow me to open more windows if I want to. Is there any way to achieve it? (Win 7) Bonus question: idk why, but closing scite will not remember my last opened files, so on next doubleclick on script will open that script only, effectively closing all other scripts. If I open by scite shortcut dorectly, last open scripts are kept open, but if I by mistake open scite by script, I have to reopen all previous scripts again. How can I set that no matter the way scite opens, it will also open all scripts it had open when I close it? Thanks!
  5. Today
  6. as i understand, TCPStartUp() works for the entire process, and is scope-agnostic. suppose i'm writing a UDF that makes use of TCP. i neither know nor care if the calling script uses TCP too. the calling script may or may not call TCPStartUp() or TCPShutDown() at its discretion. should i be concerned about that at all? my initial thought was to mandatory call TCPStartUp() in my UDF, and register an OnExit function for TCPShutDown(). but what if the calling script does the same? what if the calling script calls TCPShutDown() while my UDF is using it still? do i need to test for TCP status at the beginning of each function in my UDF, so i can start it if it isn't started yet? that seems too inelegant. ideas?
  7. Referring to following coding and image, if oFrame is not available, I would like to know on what to look for based on following image. Do you have any suggestions? Thank you very much for any suggestions (^v^) #include <Constants.au3> #include <IE.au3> #include <Array.au3> Opt ("MustDeclareVars", 1) Local $oIE = _IECreate("https://www.cmegroup.com/trading/interest-rates/countdown-to-fomc.html") If Not IsObj ($oIE) Then Exit MsgBox ($MB_SYSTEMMODAL,"","Error creating IE object") Local $oFrame = _IEFrameGetObjByName ($oIE,"out") If Not IsObj ($oFrame) Then Exit MsgBox ($MB_SYSTEMMODAL,"","Error searching for frame") Local $oTDs = _IETagNameGetCollection ($oFrame, "td") If Not IsObj ($oTDs) Then Exit MsgBox ($MB_SYSTEMMODAL,"","Error gathering tag collection") Local $sValue For $oTD in $oTDs $sValue = _IEPropertyGet ($oTD, "innertext") If @error or $sValue = "" Then ContinueLoop If $sValue = "200-225" Then $sValue = $oTD.nextElementSibling.innerText ;which return 0.0% $sValue = $oTD.nextElementSibling.innerText ;which return 2.0% $sValue = $oTD.nextElementSibling.innerText ;which return 3.9% ExitLoop Endif Next MsgBox ($MB_SYSTEMMODAL,"",Number($sValue)) _IEQuit ($oIE)
  8. i once toyed with the idea, after reading "The Blind Watchmaker" and "The Selfish Gene" (by Richard Dawkins). both books describe computer simulations of evolutionary processes. i might be able to chip in. what algorithms are you using?
  9. Thanks a lot for your help! I'm sorry if I didn't replied, but I was sick 🤒
  10. Hello sir, how about toggle "listen to this device" in microphone properties. Can we using autoit.? i cant found some reference, maybe you can help
  11. He is referring to my post above, with regards to Rovers code, here is a complete step by step version: nb: I'm going to use C:\AutoItScript directory as an example just change it to where ever you wish to save your script a. Copy "C:\Program Files (x86)\AutoIt3\Include\RichEdit.au3" to "C:\AutoItScripts\RichEdit.au3" b: Rename: "C:\AutoItScripts\RichEdit.au3" to "C:\AutoItScripts\RichEditEx.au3" b. Open "C:\AutoItScripts\RichEditEx.au3" in Scite c. At line 25 add the following variables: Global Const $DROPEFFECT_COPY = 1 Global Const $DROPEFFECT_MOVE = 2 Global Const $MK_ALT = 0x20 Global Const $MK_CONTROL = 0x8 Global $iMode, $hDragSource, $_GRE_sRTFClassName d. Replace the following function nb: On my version of RichEditEx.au3 it starts at line 3707 ; #INTERNAL_USE_ONLY# =========================================================================================================== ; Name...........: __RichCom_Object_GetDragDropEffect ; Description ...: ; Syntax.........: __RichCom_Object_GetDragDropEffect ( $pObject, $bDrag, $iGrfKeyState, $piEffect ) ; Parameters ....: ; Return values .: ; Author ........: ; Modified.......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: ; =============================================================================================================================== Func __RichCom_Object_GetDragDropEffect($pObject, $bDrag, $iGrfKeyState, $piEffect) #forceref $pObject, $bDrag, $iGrfKeyState, $piEffect Return $_GCR_E_NOTIMPL EndFunc ;==>__RichCom_Object_GetDragDropEffect With ; #INTERNAL_USE_ONLY# =========================================================================================================== ; Name...........: __RichCom_Object_GetDragDropEffect ; Description ...: ; Syntax.........: __RichCom_Object_GetDragDropEffect($pObject, $fDrag, $grfKeyState, $pdwEffect) ; Parameters ....: ; Return values .: ; Author ........: ; Modified.......: rover 2k12 ; Remarks .......: Patch to demonstrate issue with RichEdit defaulting to DROPEFFECT_COPY+DROPEFFECT_MOVE for drag and drop events between source/destination ($pdwEffect value = 3) ; ...............: Drop Effect should change depending on source/destination. Key modifiers should work the same way as Wordpads RichEdit (MS WordPad would be a RichEdit standard I assume?) ; Related .......: ; Link ..........: ; Example .......: ; =============================================================================================================================== Func __RichCom_Object_GetDragDropEffect($pObject, $fDrag, $grfKeyState, $pdwEffect) #forceref $pObject, $fDrag, $grfKeyState, $pdwEffect If $fDrag Then ;only sent once at start of drag within same edit or between edits in script process ;TRUE if the query is for a IDropTarget::DragEnter or IDropTarget::DragOver. FALSE if the query is for IDropTarget::Drop. $hDragSource = _WinAPI_GetFocus() ;get drag source handle (only used for comparing to another AutoIt Richedit control) Return $_GCR_E_NOTIMPL EndIf If $grfKeyState = ($MK_CONTROL + $MK_ALT) Then $grfKeyState = 0 ; A Ctrl/Alt key combination does a drag copy between windows, so might as well allow for it. Switch $grfKeyState ;= 0 or key modifier only when mouse released, now we set the drop effect Case 0, $MK_CONTROL, $MK_ALT ;_WinAPI_GetFocus() not working here, always returns source handle of 1st richedit when over 2nd richedit in same gui Local $tDROPEFFECT = DllStructCreate("dword", Ptr($pdwEffect)) Local $tPoint = DllStructCreate($tagPOINT) Local $iOpt = Opt("MouseCoordMode", 1) DllStructSetData($tPoint, "x", MouseGetPos(0)) DllStructSetData($tPoint, "y", MouseGetPos(1)) Opt("MouseCoordMode", $iOpt) Local $hWnd = _WinAPI_WindowFromPoint($tPoint) $iMode = $DROPEFFECT_COPY ;default: $MK_LBUTTON Or $MK_RBUTTON - DD between source/destination If $grfKeyState = $MK_ALT Then $iMode = $DROPEFFECT_MOVE ;DD between source/destination If $hDragSource = $hWnd And (IsHWnd($hDragSource) + IsHWnd($hWnd)) <> 0 Then $iMode = $DROPEFFECT_COPY + $DROPEFFECT_MOVE ;DD within same edit (No key, $MK_ALT or $MK_CONTROL modifier keys) DllStructSetData($tDROPEFFECT, 1, $iMode) $hDragSource = 0 ;reset source handle (not set for a drag from an external process ($fDrag = False )) EndSwitch Return $_GCR_E_NOTIMPL EndFunc ;==>__RichCom_Object_GetDragDropEffect e. Save "C:\AutoItScripts\RichEditEx.au3" f. Create a new script: "C:\AutoItScripts\RichEdit_DragDrop_Example.au3" g. Paste the following and run, you should now be able to drag and drop urls from browser into either of the RIchEdit text boxes: #include <GUIConstantsEx.au3> #include "GuiRichEditEx.au3" #include <WindowsConstants.au3> #Include <GuiScrollBars.au3> #include <ScrollBarConstants.au3> #include <WinAPI.au3> #include <Misc.au3> Opt("GUIOnEventMode", 1) Opt('MustDeclareVars', 1) Global $g_iDLLUser32 = DllOpen("User32.dll"), $g_idRich1, $g_idRich2 _DualRichEdit() Func _DualRichEdit() Local $hForm = GUICreate("", 600, 300, -1, -1,-1 ,BitOR($WS_EX_WINDOWEDGE, $WS_EX_TOPMOST)) GUISetOnEvent($GUI_EVENT_CLOSE, "Terminate") GUICtrlCreateLabel("First Rich Text Field", 10, 10) GUICtrlCreateLabel("Second Rich Text Field", 304, 10) GUICtrlCreateLabel("Enter text into the first field ... then highlight it and drag/drop it into the second field.", 10, 250, 580, -1) GUICtrlSetFont(-1, 11, 400, -1, "Arial") GUICtrlCreateLabel("I need the dropped text to remain in the first field ... and preferably remain highlighted.", 10, 270, 580, -1) GUICtrlSetFont(-1, 10, 800, -1, "Arial") $g_idRich1 = _GUICtrlRichEdit_Create($hForm, "", 15, 30, 280, 215, BitOR($ES_WANTRETURN, $ES_MULTILINE, $WS_VSCROLL)) _GUICtrlRichEdit_SetEventMask($g_idRich1, $ENM_DRAGDROPDONE) _GUIScrollBars_ShowScrollBar($g_idRich1, $SB_VERT, True) $g_idRich2 = _GUICtrlRichEdit_Create($hForm, "", 305, 30, 280, 215, BitOR($ES_WANTRETURN, $ES_MULTILINE, $WS_VSCROLL)) _GUICtrlRichEdit_SetEventMask($g_idRich2, $ENM_DRAGDROPDONE) _GUIScrollBars_ShowScrollBar($g_idRich2, $SB_VERT, True) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") GUISetState() While 1 Sleep(50) WEnd EndFunc Func WM_NOTIFY($hWnd, $iMsg, $iWparam, $iLparam) #forceref $hWnd, $iMsg, $iWparam Local $hWndFrom, $iCode, $tNMHDR $tNMHDR = DllStructCreate($tagNMHDR, $iLparam) $hWndFrom = DllStructGetData($tNMHDR, "hWndFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch __WinAPI_GetClassName($hWndFrom) ;replace with handles, Case $_GRE_sRTFClassName ;~ if not restoring text selection on multiple richedits Switch $iCode Case $EN_DRAGDROPDONE If $hWndFrom <> _WinAPI_GetFocus() Then ;re-show selected text only on drag beween edits _GUICtrlRichEdit_HideSelection($hWndFrom, False) EndIf EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY Func __WinAPI_GetClassName($hWnd) Local $aResult = DllCall($g_iDLLUser32, "int", "GetClassNameW", "hwnd", $hWnd, "wstr", "", "int", 4096) If @error Then Return "" Return $aResult[2] EndFunc ;==>__WinAPI_GetClassName Func Terminate() _GUICtrlRichEdit_Destroy($g_idRich1) _GUICtrlRichEdit_Destroy($g_idRich2) Exit EndFunc
  12. @Lourens The site uses ReactJS, which is difficult to automate. You may want to review this past thread. I suspect it would be easier to automate using either the Webdriver UDF or IUIAutomation.
  13. hey well, can you post your code and explain what exactly going wrong if you already finished everything else? i mean it's easier to understand your problem and you will get a more tailored answers for your code i guess. (btw im not that good at engl) Greetings
  14. Yesterday
  15. Right... I was just testing with this -- #include <IE.au3> $oIE = _IECreate("https://bank.tymedigital.co.za/)") $oForm = _IEFormGetCollection($oIE, 0) $oUser = _IEFormElementGetCollection($oForm, 0) $oPass = _IEFormElementGetCollection($oForm, 1) _IEFormElementSetValue($oUser, "12345678") _IEFormElementSetValue($oPass, "abcdefgh") _IEFormSubmit($oForm) It's possible that there is underlying events that need to be triggered for the login to work correctly.
  16. I have found another script by @funkey I have modified the script, however, the form does not recognize the values submitted even though it is visible in the form fields. #include <IE.au3> $Url = 'https://bank.tymedigital.co.za/' $User = '0000000000000' $Pwd = 'This_Is_Not_The_Password' $test = _IEAutoLogin($Url, $User, $Pwd) Func _IEAutoLogin($sUrl, $sUsername, $sPwd) $oIE = _IECreate($sUrl) _IEErrorNotify(False) _IEErrorHandlerRegister() $oForms = _IEFormGetCollection($oIE) If @error Then Return SetError(1, _IEErrorHandlerDeRegister(), $oIE) Else $Index = 0 For $oForm In $oForms $oFormElements = _IEFormElementGetCollection($oForm) If IsObj($oFormElements) Then $IndexElement = 0 For $oElement In $oFormElements For $i = $IndexElement - 1 To 0 Step -1 $oPwd = _IEFormElementGetCollection($oForm, $i) If $oPwd.Type = 'password' Then _IEFormElementSetValue($oPwd, $sPwd) ExitLoop EndIf Next For $i = $IndexElement - 1 To 0 Step -1 $oUser = _IEFormElementGetCollection($oForm, $i) If $oUser.Type = 'tel' Then _IEFormElementSetValue($oUser, $sUsername) ExitLoop EndIf Next For $i = $IndexElement + 1 To $IndexElement + 10 $oButton = _IEFormElementGetCollection($oForm, $i) If $oButton.Type = 'button' Then _IEAction($oButton, "click") ExitLoop EndIf Next $IndexElement += 1 Next EndIf $Index += 1 Next EndIf EndFunc ;==>_IEAutoLogin Attached is a screen shot of the error - it still produce the same error whether a valid id number is submitted or not. When an invalid values are submitted the error will be "Invalid SAID or password". Thank you, Lourens
  17. Maybe you refer to sqlite3.dll instead. Just put it where you load it from: you invoke loading as _SQLite_Startup(@ScriptDir & "\" & "sqlite3.dll", false, 1) so @ScriptDir is a pretty good place. Note that the help says that the DLL " can be stored in @ScriptDir, @SystemDir, @WindowsDir, or @WorkingDir. "
  18. Oh it's the ControlLabel that is stored in $aNotify_Data[$aNotify_Data[0][0]][9] All I have to do is reading the stored GuiControl Local $sMsg = GUICtrlRead($aNotify_Data[$aNotify_Data[0][0]][9]) Thread can be closed And thanks for this awesome UDF @Melba23
  19. I want to use a modified WM_MOUSEACTIVATE when clicking on a Notificaion instead the _Notify_RegMsg(). My goal: I want read the message of the clicked Notification and start another function depending on the message In the Notifiy UDF I could find in Line 683 that the Message is stored in $aNotify_Data[$aNotify_Data[0][0]][9] but it shows only a number anyone here knows wher I can find the stored notification message ? Func WM_MOUSEACTIVATE($hWnd, $iMsg, $wParam, $lParam) #forceref $iMsg, $wParam, $lParam ConsoleWrite(@CRLF & "$hWnd=" & $hWnd) For $i = $aNotify_Data[0][0] To 1 Step -1 ; Is it a click on a notification? If $hWnd = $aNotify_Data[$i][0] Then ; Check if other action occuring If $bNotify_Action Then ; Clear click on this notification AdlibRegister("_Notify_ResetClick", 100) Else $aNotify_Data[0][5] = $i If $aNotify_Data[$i][5] Then ; Extend the notification AdlibRegister("_Notify_Extend", 100) Else ; Delete the notification if clickable If $aNotify_Data[$i][3] Then ConsoleWrite(@CRLF & "$aNotify_Data[0][0]= " & $aNotify_Data[0][0]) ConsoleWrite(@CRLF & "$aNotify_Data[0][1]= " & $aNotify_Data[0][1]) ConsoleWrite(@CRLF & "$aNotify_Data[0][2]= " & $aNotify_Data[0][2]) ConsoleWrite(@CRLF & "$aNotify_Data[0][3]= " & $aNotify_Data[0][3]) ConsoleWrite(@CRLF & "$aNotify_Data[0][4]= " & $aNotify_Data[0][4]) ConsoleWrite(@CRLF & "$aNotify_Data[0][5]= " & $aNotify_Data[0][5]) ConsoleWrite(@CRLF & "$aNotify_Data[0][6]= " & $aNotify_Data[0][6]) ConsoleWrite(@CRLF & "$aNotify_Data[$i][1]= " & $aNotify_Data[$i][1]) ConsoleWrite(@CRLF & "$aNotify_Data[$i][2]= " & $aNotify_Data[$i][2]) ConsoleWrite(@CRLF & "$aNotify_Data[$i][3]= " & $aNotify_Data[$i][3]) ConsoleWrite(@CRLF & "$aNotify_Data[$i][4]= " & $aNotify_Data[$i][4]) ConsoleWrite(@CRLF & "$aNotify_Data[$i][5]= " & $aNotify_Data[$i][5]) ConsoleWrite(@CRLF & "$aNotify_Data[$i][6]= " & $aNotify_Data[$i][6]) ConsoleWrite(@CRLF & "$aNotify_Data[$i][7]= " & $aNotify_Data[$i][7]) ConsoleWrite(@CRLF & "$aNotify_Data[$i][8]= " & $aNotify_Data[$i][8]) ConsoleWrite(@CRLF & "$aNotify_Data[$i][9]= " & $aNotify_Data[$i][9]) ConsoleWrite(@CRLF & "$aNotify_Data[$aNotify_Data[0][0]][9]= " & $aNotify_Data[$aNotify_Data[0][0]][9]) AdlibRegister("_Notify_Delete", 100) EndIf EndIf EndIf ExitLoop EndIf Next Return "GUI_RUNDEFMSG" EndFunc
  20. What step? If it for other purpose! what code?
  21. Oh. Well, isn't that convenient. Guess I'll google my issue next time. (Thank you though, I try)
  22. I know how to use normal pixelsearches throughout the screen for various colors, but what I'd like to learn how to do is determine where the center of those detected pixels are. I wasn't entirely sure how to explain this in words so I threw a picture together. So basically its scanning the center of the screen, but instead of the appropriate pixels triggering whatever event to take place, those pixels have to be centered regardless of size and how much space they take of. Is something like this possible and do you have any suggestions on learning it? I basically want a certain group crossing the screen to trigger a browser refresh (easily bindable to a key F5) and then it begins a new search and some other events before it happens again. I've got everything done except for this part, but it throws off the loop because it activates as soon as the text scrolls through the center, whereas I need it to always be when the text is completely centered. Sorry if that's confusing.
  23. Browser - Internet Explorer The form fields has no name or id and I can not use _IEGetObjByName or _IEGetObjById Usually I would use _IEGetObjByName and set the value of the form field with _IEFormElementSetValue as below; Local $oUsername = _IEGetObjByName($oIE, "username") Local $oPassword = _IEGetObjByName($oIE, "password") _IEFormElementSetValue($oUsername, "username") _IEFormElementSetValue($oPassword, "password") Since _IEGetObjByType is not an option, I do not know how to proceed. Using _IEFormGetCollection inform me that there is one form on the page, however, no other useful information is returned that I can use (or I am doing something that I am not suppose to do). Thank you, Lourens
  24. @Nine I assume you meant to type _IEFormGetCollection. 😏
  25. Looks like there is only one form, so look at form _IEFrameGetCollection Then there is IETagNameGetCollection with "input". I am too tired to test your site, maybe tomorrow...
  26. Hi @Lourens, Welcome to the forum. Please post additional details so that we can better understand the issue. Things like -- Which browser you are using What isn't working as expected? Post your code (use the <> icon at the top of the editor)
  27. Not an auto-run example but perhaps a head start idea to incorporate .. #include <File.au3> Global $sd = ObjCreate("Scripting.Dictionary"), $array = _FileListToArrayRec(@DesktopDir, "*") ; array snapshot the list of files in the desktop folder For $i = 1 To UBound($array) - 1 $sd.Item($array[$i]) = 1 Next HotKeySet("{ESC}", "Terminate") ; Exit HotKeySet("^e", "Run_Display") ; ctrl + e While 1 Sleep(2000) WEnd Func Run_Display() Local $a = _FileListToArrayRec(@DesktopDir, "*"), $sdTmp = ObjCreate("Scripting.Dictionary") For $i = 1 To UBound($a) - 1 If $sd.Exists($a[$i]) Then ContinueLoop ;add any new files to $sdTmp array $sdTmp.Item($a[$i]) = @DesktopDir & "\" & $a[$i] Next $array = $a ; update main snapshot $a = $sdTmp.Items _ArrayDisplay($a) ; process new files .. EndFunc ;==>Run_Display Func Terminate() Exit EndFunc ;==>Terminate Deye
  28. Hi, I am looking for a way to automate login to a Internet Banking website (https://bank.tymedigital.co.za/) and all of the examples that I could found still do not solve my issue with this website. In order to Login, the user need to enter their Identity Number and Password the click the Login button. Inspecting the Elements in Chrome are as follow; Identity Number <input autocomplete="username" placeholder="Please enter your South African ID number" maxlength="13" type="tel" class="form-control" value=""> Password <input autocomplete="current-password" placeholder="Enter password" type="password" class="form-control" value=""> Button <button type="button" class="btn btn-yellow btn-block">Login</button> Any assistance or directing me to a solution will be appreciated. Thank you, Lourens
  1. Load more activity
×
×
  • Create New...