Leaderboard
Popular Content
Showing content with the highest reputation on 05/13/2020 in all areas
-
AutoIt v3.3.15.2 Beta View File 3.3.15.2 (13th May, 2020) (Beta) AutoIt: - Fixed: Map elements being lost due to a deep-copy logic fail. Submitter Jon Submitted 05/13/2020 Category Beta1 point
-
Im working through the tutorial and am stuck
charlie2charlie reacted to Subz for a topic
If you're wanting to use send or mouse clicks then recommend using Control.. functions (see ControlSend, ControlClick in the help file). If you wanted to write text to a file, then would recommend using FileOpen, FileWrite functions. Just my 2 cents.1 point -
Im working through the tutorial and am stuck
argumentum reacted to charlie2charlie for a topic
Cheers guys for grouping around , Im getting somewhere, slowly, but steadily. I appreciate the prompts. Cheers.1 point -
Im working through the tutorial and am stuck
charlie2charlie reacted to TheXman for a topic
The script below is the same as yours with 1 line added at the top. By default, the title string has to be an exact match starting from the beginning of the window's title. The asterisk (*) in the notepad title denotes that the file has been modified since it was last saved or created. The OPT function that I added to the script says that the string you provide for the title can appear anywhere in the title. If you use a -2, it will means it can appear anywhere in the title and is not case-sensitive. Opt('WinTitleMatchMode', 2) ;1 = Start, 2 = SubString, 3 = Exact, 4 = Advanced, -1 to -4 = Case Insensitive. run("Notepad.exe") WinWaitActive("Untitled - Notepad") send("This is some Text") WinClose("Untitled - Notepad") WinWaitActive("Notepad","Save") Send("!n") *Updated example Looks like there were a few changes to Notepad in Windows 10. The Save dialog's visible text has changed. The script above should work on Windows 10. You can lookup each command in the Help file to see how and why it works.1 point -
Im working through the tutorial and am stuck
charlie2charlie reacted to Colduction for a topic
Hi, you should see and learn about Send function in Help file, the help file has a good example for your what you want: Example() Func Example() ; Simulate the key combination Win + R to open the Run dialogue window. Send("#r") ; Wait 10 seconds for the Run dialogue window to appear. WinWait("Run", "", 10) ; Simulate entering notepad.exe and pressing the 'ENTER' key. Send("notepad.exe{Enter}") ; Wait 10 seconds for the Notepad window to appear. Local $hWnd = WinWait("[CLASS:Notepad]", "", 10) ; Simulate entering the following string and pressing the 'F5' key to input the date and time into edit control of Notepad. Send("Today's time/date is {F5}") ; Close the Notepad window using the handle returned by WinWait. WinClose($hWnd) ; Now a screen will pop up and ask to save the changes, the classname of the window is called ; "#32770" and simulating the "TAB" key to move to the second button in which the "ENTER" is simulated to not "save the file" WinWaitActive("[CLASS:#32770]") Sleep(500) Send("{TAB}{ENTER}") EndFunc ;==>Example1 point -
Im working through the tutorial and am stuck
charlie2charlie reacted to argumentum for a topic
you've got it !. So you are not stuck No clue. Updates ?1 point -
You have to trigger an "input" event on each of the input elements. The following code works for me -- #include <IE.au3> $url = "https://o" & "rdermanager." & "teca" & "llianc" & "e.net/new" & "app/" & "auth/login" $oIE = _IECreate($url) $oDoc = _IEDocGetObj($oIE) $oEvt = $oDoc.createEvent("HTMLEvents") $oEvt.initEvent("input", True, False) $oUsername = _IEGetObjById($oIE,"login-txt-username") _IEFormElementSetValue($oUsername, "me@test.com") $oUsername.dispatchEvent($oEvt) $oPassword = _IEGetObjById($oIE,"login-txt-password") _IEFormElementSetValue($oPassword, "Test1234!") $oPassword.dispatchEvent($oEvt) $oButton = _IEGetObjById($oIE,"changepwd-btn-request") _IEAction($oButton, "click")1 point
-
These are the element id's of the elements that matched your given criteria. Now go back and read me earlier response about how to process them further to get the desired property / attribute from each one. You'll need to make some adjustments since your criteria has changed. P.S. Your requirements are certainly unique. Can you share more details on what your end goal is and what website is involved?1 point
-
WebDriver UDF - Help & Support (II)
hoangvu0905 reacted to Jos for a topic
Please use this Support thread for your questions. Thanks1 point -
... it seems that at the end of each command sent to cmd, there is a request pending from the pipe asking for something to the 'caller'. (something like'do you need to send more data?') I have seen that sending an @CRLF as the first character of the next sending allows you to send further commands to cmd via NomedPipe. As if the @CRLF accepts the default answer which I suppose is "yes, I have more data to send, stay connected" (?) ... or something similar. However, although this workaround works (see line 30 in listing), it is not clear to me what happens under the hood. if anyone has a clearer idea than mine, i would be glad to know it. Thanks for any suggestions #include <NamedPipes.au3> #include <WinAPI.au3> ; Creates an instance of a named pipe Global $sPipeName = "\\.\pipe\pipename" Global $hPipe = _NamedPipes_CreateNamedPipe($sPipeName, 1, 2) Global $sPrefix = '' MsgBox(0, "Debug", "Pipe created. Now open a CMD") ; run a cmd with only StdIn redirected (StdIn data incoming from a pipe) Global $hCMD = Run(@ComSpec & " /K cmd /K < " & $sPipeName & @CRLF, "c:\") ; ok? (maybe a better way?) _StdInPipeWrite("@echo off" & @CRLF) MsgBox(0, "Debug", "Result: @error:" & @error & @TAB & "$hCMD:" & $hCMD & @CRLF & "now Send a command to the cmd via a NamedPipe") _StdInPipeWrite("cls & @Echo. & Echo Hello from AutoIt & Echo ----------------- & @Echo." & @CRLF) MsgBox(0, 'Debug', "further commands" & @CRLF & "now send command 'dir c:\windows'") $sMessage = "Dir c:\windows" & @CRLF _StdInPipeWrite($sMessage) MsgBox(0, 'Debug', "send another command)" & @CRLF & "now send command 'cls & HELP'") _StdInPipeWrite("cls & HELP" & @CRLF) MsgBox(0, "Debug", "end of test") ProcessClose($hCMD) Func _StdInPipeWrite($sMessage) $sMessage = @CRLF & $sMessage ; <----------- Workaround ; =============================================================================================================================== ; This function writes a message to the pipe ; =============================================================================================================================== Local $iWritten, $iBuffer, $pBuffer, $tBuffer $iBuffer = StringLen($sMessage) + 1 $tBuffer = DllStructCreate("char Text[" & $iBuffer & "]") $pBuffer = DllStructGetPtr($tBuffer) DllStructSetData($tBuffer, "Text", $sMessage) If Not _WinAPI_WriteFile( _ $hPipe, _ ; ...... Handle to the file to be written $pBuffer, _ ; .... Pointer to the buffer containing the data to be written $iBuffer, _ ; .... Number of bytes to be written to the file $iWritten, _ ; ... The number of bytes written 0 _ ; ............ [optional] A $tagOVERLAPPED structure or a pointer to it ) Then ConsoleWrite("WriteMsg: _WinAPI_WriteFile failed" & @CRLF & _WinAPI_GetLastErrorMessage()) Else ConsoleWrite("WriteMsg: write OK" & @CRLF & _WinAPI_GetLastErrorMessage() & @CRLF) EndIf EndFunc ;==>_StdInPipeWrite1 point
-
Hi everyone, Some good news for you among all the gloom of these virus-ridden times: Nine, Subz and Danyfirex have accepted the invitation to become MVPs. Please join me in congratulating them on their new status in our community. Keep safe out there, M231 point
-
Somethin like this? Global $aNames[][] = [["Name-1-1", "Name-1-2", "Name-1-3"], ["Name-2-1", "Name-2-2"], ["", "Name-3-1"], ["", "Name-4-1", "Name-4-2"], ["Name-5-1", "", "Name-5-2"]] For $i = 0 To UBound($aNames, 1) - 1 ; Count number of names in each row $iCount = 0 For $j = 0 To UBound($aNames, 2) - 1 If $aNames[$i][$j] <> "" Then $iCount = $iCount + 1 Next ; Create the output string $sOut = "" For $j = 0 To UBound($aNames, 2) - 1 If $aNames[$i][$j] <> "" Then Switch $iCount Case 1 ; one name in the row $sOut = $aNames[$i][$j] ExitLoop Case 2 ; two names in the row If $sOut = "" Then ; name one of two $sOut = $aNames[$i][$j] Else ; name two of two $sOut = $sOut & " and " & $aNames[$i][$j] ExitLoop EndIf Case 3 ; three names in the row If $sOut = "" Then ; name one of three $sOut = $aNames[$i][$j] & ", " ElseIf StringRight($sOut, 2) = ", " Then ; name two of three $sOut = $sOut & $aNames[$i][$j] & " and " Else ; name three of three $sOut = $sOut & $aNames[$i][$j] EndIf EndSwitch EndIf Next ConsoleWrite($sOut & @CRLF) Next1 point
-
AutoIt v3.3.14.5 has been released. Just a small bug fix to the updater script. Download it here. Complete list of changes: History1 point
-
Hi, You may well be getting a warning from your browser that the site SSL certificate has expired - and indeed it has. When Jon last moved server the automatic alert for certificate expiry was not carried over. He is on the case, but it may take a while to get the certificate renewed. In the meantime, nothing has changed here and the site is as secure as it ever was. Our apologies for the inconvenience - we hope things will be back to normal soon. M231 point
-
Z-Order, how to restore a window's position ?
PoojaKrishna reacted to PsaltyDS for a topic
WinList(), with no options, lists all windows in Z-order, allowing you to save the previous order in a 2D arra. One usage of this is _WinPrevious().1 point -
How To Hide Window Title Bar?
behdadsoft reacted to tonedeaf for a topic
If you don't want the title bar, you can use any of these two styles in GUICreate() > $WS_POPUP - Creates a window without a title bar, and without border. > $WS_POPUPWINDOW - Creates a windows without a title bar but with a border.1 point