Leaderboard
Popular Content
Showing content with the highest reputation on 08/13/2020 in all areas
-
Installation next button
Musashi and one other reacted to Earthshine for a topic
If silent isn't an option, use my WaitForControls.au3 and Log4a.au3 to log everything. I have helped several people automate installers here. The UDF (WaitForControls.au3) will automatically wait forever, unless you specify a timeout for a control and try to click it. Study that code to find out how you properly wait in a dynamic fashion I have included the logger you need. I can post a quick starter program to help get you started. Already did it earlier on the forum a day ago. Example to start installing Notepad++, someone wanted to click on the language selector #include <Timers.au3> #include <GUIConstantsEx.au3> #include "WaitForControls.au3" #include "log4a.au3" #RequireAdmin #Region ;**** Logging **** ; Enable logging and don't write to stderr _log4a_SetEnable() ; Write to stderr, set min level to warn, customize message format _log4a_SetErrorStream() _log4a_SetMinLevel($LOG4A_LEVEL_TRACE) ; If @compiled Then _log4a_SetMinLevel($LOG4A_LEVEL_WARN) ; Change the min level if the script is compiled _log4a_SetFormat("${date} | ${host} | ${level} | ${message}") #EndRegion ;**** Logging **** Const $TD_BTN_NEXT = '&Next >' Const $TD_BTN_INSTALL = '&Install' Const $TD_BTN_CANCEL = 'Cancel' Const $TD_BTN_FINISH = 'Finish' Const $TD_BTN_UNINSTALL = '&Uninstall' Const $TD_BTN_CLOSE = 'Close' Const $TD_BTN_YES = '&Yes' Const $TD_CBO_LANG = 'English' Const $formclass = "[CLASS:#32770]" Const $Edit = "[CLASS:Edit; INSTANCE:1]" Const $button1 = "[CLASS:Button; INSTANCE:1]" Const $button2 = "[CLASS:Button; INSTANCE:2]" Const $button3 = "[CLASS:Button; INSTANCE:3]" Const $cbolanguage = "[CLASS:ComboBox; INSTANCE:1]" Const $langInst = 'Installer Language' instNotepad() Func instNotepad() _log4a_Info('instNotepad:Begin') _CheckClickCtrl($formclass, $langInst, $cbolanguage, $TD_CBO_LANG, 0, 0) _log4a_Info('instNotepad():End') EndFunc ;==>instNotepad As you can see, I have defined the Button text for the Next button using a call to that same function that is poking the Language Selector Combobox Get the files you need from the first link I posted and you can see in my example program, they are included. There is extra stuff in the example to try and show you how you might also do things in a predictable manner and use variables. Use the Information Tool that comes with AutoIt and get all the buttons and combobox and edit controls you want to interact with. Then define them as a Const like I did so you can call that funciton in the udf that waits to click until the control exists and is responsive2 points -
Looks like the new instance of the tooltip uses/adds some of the settings from the previous instance. I'v played a bit with the scripts and this is the solution: #include <AutoItConstants.au3> ToolTip("This is tooltip 2", 45, 10, "", $TIP_NOICON, $TIP_CENTER) Sleep(3000) ToolTip("",0,0,"",0,$TIP_BALLOON) ToolTip("This is tooltip 1", 1, 2) Sleep(3000) Simply, reset/clear the tooltip as ToolTip("",0,0,"",0,$TIP_BALLOON)2 points
-
The OP is looking for a way to monitor or "see" the serial conversation to & from the box in order to see what the test program is doing. The OP is basically looking for a serial man-in-the-middle (MITM) type of tool, or serial port Sniffer. A tool that can see what is "coming across the wire" without interfering with it. I don't think the UDF that you suggested has that capability. Most serial communication tools and UDFs designed to converse with serial devices wont either. Although, I could be wrong. Here's another topic that may be a little more relevant:2 points
-
Version 1.7.0.1
10,051 downloads
Extensive library to control and manipulate Microsoft Outlook. This UDF holds the functions to automate items (folders, mails, contacts ...) in the background. Can be seen like an API. There are other UDFs available to automate Outlook: OutlookEX_GUI: This UDF holds the functions to automate the Outlook GUI. OutlookTools: Allows to import/export contacts and events to VCF/ICS files and much more. Threads: Development - General Help & Support - Example Scripts - Wiki BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort KNOWN BUGS (last changed: 2020-02-09) None1 point -
In fact, infinitely drawing infinity, you should say it is a Möbius ring.1 point
-
I think this could be a good candidate for Bug Tracker though.1 point
-
Installation next button
Earthshine reacted to Musashi for a topic
Have you checked, if the respective setup routines of your desired programs allow control via command line parameters? If this is the case, this variant would be more reliable.1 point -
Capture Serial Communications
Earthshine reacted to TheXman for a topic
If you have an older 32-bit Windows PC or laptop around, you may be able to convince your IT people to allow you to use the SysInternals Portmon utility. It's free, easy to use, and SysInternals is now a part of, and hosted by, Microsoft.1 point -
Capture Serial Communications
TheXman reacted to Earthshine for a topic
yeah, that was the SECOND hit.... thanks1 point -
Making the integration between AutoIt and the BrowserControl easier may facilitate the development of interesting programs. Just think of all those (fantastic) libraries and frameworks available for javascript that could be integrated and exploited in an AutoIt program. For example, to graphically present the results of an AutoIt processing in the GUI, ... and many other possibilities. Providing the basic functions to implement this synergistic interaction is the purpose of this post (if for no other reason, just even to collect some tests done over time here and there, so as not to leave them scattered and easily find them in just one place) In this UDF there are only a few functions (or better if called wrappers), but I hope to add more as I go and, even better, to receive suggestions and advice on new features and techniques to improve and expand it. _WebBrowser_GUICtrlCreate Create an Internet Explorer 'Browser Control' _WebBrowser_SetHTML Set a new HTML listing in the BrowserControl _WebBrowser_CSS_Inject Creates into the html document a CSS node element with embedded the passed CSS _WebBrowser_JS_Inject Creates into the html document a javascript node element with embedded the passed javascript _WebBrowser_JS_Eval Evaluates a passed string as JavaScript code and executes it _WebBrowser_JS_setTimeout Calls a javascript function or executes a javascript code snippet [option after a specified delay] _WebBrowser_JS_ElementGetRef Retrieves a reference to an element suitable to be used from AutoIt _WebBrowser_ExecuteDotNotation Get a reference to an object's child member or the value of a property, by means of a dotted path _WebBrowser_BasicHTML Returns a basic html page listing (a little enhanced than about:blank) The three examples provided in the attached ziped file are a bit 'improvised' and do not take advantage of all the possibilities offered by the underlying javascript libraries used. They are just three "hello world" scripts to test the ABC of the interaction with the "BrowserControl". (ToDo: Interaction with javascript custom events) Bug reports, creative criticisms and suggestions (particularly regarding the interaction with javascript custom events) are welcome I hope you can have fun with the Browser Control BrowserControl.zip1 point
-
Probably due to _IECreateEmbedded using the equivalent of IE7. See this thread for a solution --1 point
-
Capture Your Own Console Output
Marc reacted to seadoggie01 for a topic
I'm working on a project right now for another department at work and I'm not in IT so I don't have great remote access to their computers. I'm trying to get a finicky internal website to be automated with some financial data, but Finance needs to be running the script since they have access to the non-testing site. Currently, the amazing WebDriver UDF uses ConsoleWrite to output debugging data, which works great on my computer. Finance isn't tech savy and would really like a one-file solution. I need to be able to capture this output and email it back to myself in the case of an error (which happens a lot). This code can be inserted to the beginning of my script to allow me to run my script from the exe, capture the output, and (with another function) email the results back to myself. In case anyone is interested, it's kind of a neat way to do things, I thought ; Required for using /AutoIt3ExecuteScript on another AutoIt3 Script #pragma compile(AutoItExecuteAllowed, True) ; Run Au3Stripper #AutoIt3Wrapper_Run_Au3Stripper=y ; Merge only, just add in all required constants and functions #Au3Stripper_Parameters=/mo #include <AutoItConstants.au3> ParentOnlyCode() Main() Func ParentOnlyCode() ; The parent is compiled. Skip this if not compiled. If Not @Compiled Then Return ; The child is named exactly like the source code (ScriptName.au3) Local $sAu3File = StringReplace(@ScriptFullPath, ".exe", ".au3") ; File Install the source code to the current directory FileInstall(@ScriptFullPath, $sAu3File) ; The command to execute Local $sCmd = '"' & @AutoItExe & '" /AutoIt3ExecuteScript "' & $sAu3File & '"' ; Run the command and capture the Console output Local $iPID = Run($sCmd, "", @SW_HIDE, $STDERR_MERGED) If @error Then ; Do something here in case of a Run error Exit MsgBox(0, "", "Run Error: " & @error) EndIf ; Wait for the script to close ProcessWaitClose($iPID) ; Capture the exit code Local $iExitCode = @extended ; Read the Console output Local $sText = StdoutRead($iPID) $sText &= @CRLF & @CRLF & "Exit code: " & $iExitCode ; Write it to a file FileWrite(@ScriptDir & "\output.txt", $sText) ; Optionally, delete the Au3 file here FileDelete($sAu3File) ; Done. Don't execute the Main script. Exit EndFunc Func Main() ; This text would normally be lost in a Compiled script, it will be written to output.txt ConsoleWrite("Doing Main stuff" & @CRLF) EndFunc1 point -
ToDo Finder
mLipok reacted to seadoggie01 for a topic
I created a few topics related to this a while ago and I think the script is good enough to release for now with some updates to come soon. To make your #ToDo: items have red (by default) coloring, edit your (SciTE Home Dir)\Properties\au3.keywords.properties file on this line: au3.keywords.special=#endregion #forcedef #forceref #ignorefunc #pragma #region #todo There's still some features I would like to implement... like a resizable GUI, a nice looking GUI, an ini file to store the search paths, open on double click, etc. Right now, it features: Jumping to the line of the ToDo item in the specified file Opening any file found Multi line items (each trailing line must begin with #) ToDo Finder.au31 point -
I figured out what I was doing wrong here. I had to add in the logon flag as a 2 after the $sPassword variable. Once I did that it processed successfully even with MMC and DSA.msc defined. So basically I changed below: RunAs($TargetUsername, $TargetDomain, $TargetPassword, 2, 'C:\Windows\System32\mmc.exe "C:\Windows\System32\dsa.msc"', "", @SW_SHOWMAXIMIZED) Hope this helps someone else.1 point
-
AlexChernavsky, Then you need my StringSize UDF (look in my sig for the link) and a bit of maths: #include <StaticConstants.au3> #include "StringSize.au3" Const $iGUIWidth = 800 Const $iGUIHeight = 200 $hGui = GUICreate("Testing", 800, 200) GUISetFont(20) GUISetState() $hLabelMessage = GUICtrlCreateLabel("Vertically centered", 0, 0, 800, 200, $SS_CENTERIMAGE) Sleep(900) GUICtrlDelete($hLabelMessage) $hLabelMessage = GUICtrlCreateLabel("Horizontally centered", 0, 0, 800, 200, $SS_CENTER) Sleep(900) GUICtrlDelete($hLabelMessage) ; Get the size of label needed to hold the text $aRet = _StringSize("Both vertically" & @CRLF & "and horizontally centered", 20) ; Work out where it needs to be on the GUI $iX = ($iGUIWidth - $aRet[2]) / 2 $iY = ($iGUIHeight - $aRet[3]) / 2 ; And create it $hLabelMessage = GUICtrlCreateLabel("Both vertically" & @CRLF & "and horizontally centered", $iX, $iY, $aRet[2], $aRet[3], $SS_CENTER) Sleep(900)Looks close enough. M231 point
-
It seems to me that I used $SS_CENTERIMAGE to get vertical centering on a label control.1 point
-
Hi, I already ask the same question: Get Clicked on checkbox of ListView Here is another solution: #include <GUIConstants.au3> #Include <GuiListView.au3> GUICreate("ListView Item Сhecked") $hListView = GUICtrlCreateListView("Column 1|Column 2", 10, 10, 380, 360, -1, $LVS_EX_CHECKBOXES+$WS_EX_DLGMODALFRAME ) For $i = 1 To 10 GUICtrlCreateListViewItem("Item " & $i & "|SubItem " & $i, $hListView) Next $Status_Label = GUICtrlCreateLabel("", 10, 385, 380, 15, $SS_SUNKEN) GUISetState() GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") While 1 Switch GuiGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func ItemChecked_Proc($iItem, $sState) GUICtrlSetData($Status_Label, "<" & $iItem & "> is checked = " & $sState) EndFunc Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView $hWndListView = $hListView If Not IsHWnd($hListView) Then $hWndListView = GUICtrlGetHandle($hListView) $tNMHDR = DllStructCreate($tagNMHDR, $lParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndListView Switch $iCode Case $NM_CLICK, $NM_DBLCLK, $NM_RCLICK, $NM_RDBLCLK Local $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam) Local $iIndex = DllStructGetData($tInfo, "Index") If $iIndex <> -1 Then Local $iX = DllStructGetData($tInfo, "X") Local $iPart = 1 If _GUICtrlListView_GetView($hListView) = 1 Then $iPart = 2 ;for large icons view Local $aIconRect = _GUICtrlListView_GetItemRect($hListView, $iIndex, $iPart) If $iX < $aIconRect[0] And $iX >= 5 Then ItemChecked_Proc(_GUICtrlListView_GetItemText($hListView, $iIndex), _ _GUICtrlListView_GetItemChecked($hListView, $iIndex) = 0) Return 0 EndIf EndIf EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc1 point