Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/10/2020 in all areas

  1. Use adodb activex object with objcreate. ObjCreate("ADODB.Connection") search forum for examples
    1 point
  2. 1. Start notepad.exe or calc.exe from script read help on run and runwait 2. check faq31. Start with au3inf to see what is shown. 3. Use send to type text or controlclick to click 4. Click file menu and save to have popup. See what au3inf is telling you. 5. Do above to really understand the concepts before continuing with other applications.
    1 point
  3. It is there. $Count += 1 already doing it but it is stopping at 10 elements since the array is bound to 10, you can increase the number of elements if you wish to. Add MsgBox (0,"",$Count) after loop to know how many links were found.
    1 point
  4. Should be : For $Count=0 to 9 If $oLink.className & "" = "movie-poster col-xs-3 no-padding" Then $oFound [$Count] = $oLink EndIf Next The way you wrote it, "Count" is converted to 0. But I do not understand why you would put 10 times the same exact object in the array. Maybe this is what you meant to write ? #include <IE.au3> Local $oIE = _IECreate("http://hiva.site") Local $oFound [10], $Count = 0 Local $colLinks = _IELinkGetCollection($oIE) For $oLink In $colLinks If $oLink.className = "movie-poster col-xs-3 no-padding" Then $oFound [$Count] = $oLink $Count += 1 If $Count = UBound($oFound) Then ExitLoop EndIf Next  _IEAction ($oFound [1], "click")
    1 point
  5. Jos

    Loops

    yes you can as this post, posted from my phone, shows. , but you need to type the bbcode: [ code ] ....... [ /code ] (without the spaces) Jos
    1 point
  6. thats all you have to do now all you have to do is call functions from the script and add in the required parameters... files that end in .au3 aren't dlls. dll file ends in .dll. Sry duh, put the imagesearch.au3 in the include file in your autoit directory.
    1 point
  7. Something like this I guess $a = 3 Local $aArray[1] = ["a"] ConsoleWrite(Eval($aArray[0]) & @CRLF) $a = 6 ConsoleWrite(Eval($aArray[0]) & @CRLF) setAVariable($a, 25) ConsoleWrite(Eval($aArray[0]) & @CRLF) Func setAVariable(ByRef $a, $i) $a = $i EndFunc output 3 6 25
    1 point
  8. Microfocus UFT will not help much on PDF. Uia automation will work fine. Potentially you have an activex installed for pdf manipulation which you can load with objcreate. The names AcroExch.App and AxAcroPDFLib.AxAcroPDF are the external strings OLE clients use to create objects of certain types. The Acrobat developer type libraries call them CAcro.App and AcroPDFLib, respectively.
    1 point
  9. Subz

    Click element By Text

    First find out what the index number is of the H3 object using the following code: #include <IE.au3> Local $oIE = _IECreate("konsalnet.pl", 1) _IELoadWait ($oIE) Local $oH3s = _IETagNameGetCollection($oIE, "h3") For $i = 0 To ($oH3s.Length - 1) ConsoleWrite("H3 Tag " & $i & ": " & $oH3s($i).InnerText & @CRLF) Next Once you know the index of the object you can use something like: #include <IE.au3> Local $oIE = _IECreate("konsalnet.pl", 1) _IELoadWait ($oIE) Local $oH3s = _IETagNameGetCollection($oIE, "h3") Local $oH3 = $oH3s(1) ;~ Formularz kontaktowy H3 tag _IEAction($oH3, "click")
    1 point
  10. Subz

    Click element By Text

    If you don't have text then, you need to identify the div, either by name, id or class name attributes, you may even have to select an element before it and use next/previous sibling. Example: #include <IE.au3> Local $oIE = _IECreate("konsalnet.pl", 1) _IELoadWait ($oIE) ;~ You would normally just use _IEGetObjById($oIE, "contact-form-btn") but just showing how to use h3 collection Local $oH3s = _IETagNameGetCollection($oIE, "h3") For $oH3 In $oH3s If $oH3.id = "contact-form-btn" Then ;~ Get the innertext from the div before the h3 tag ConsoleWrite($oH3.PreviousSibling.InnerText & @CRLF) EndIf ;~ Or you could use class name of the h3 tag as an identifier ;~ nb: Class names are generally not recommended unless you know that is the only H3 Tag with that class name. If $oH3.ClassName = "formularz-rozwin" Then ExitLoop _IEAction($oH3, "click") Next
    1 point
  11. That _NTP_FT function seems not to work behind a proxy. I use this function to get the date which should be accurate. #include <Array.au3> Global $iError = 0, $oErrorChk = ObjEvent("AutoIt.Error", "ObjErrChk") $aResult = GetDateFromINet() If @error Then ConsoleWrite("Error connecting to internet!" & @CRLF) Else _ArrayDisplay($aResult) EndIf Func GetDateFromINet($bProxy = False, $sProxy = "", $sURL = "http://www.google.com/") Local $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") If $iError Then Return SetError(1, 0, 0) If $bProxy Then $oHttp.SetProxy(2, $sProxy) $oHTTP.Open("GET", $sURL, False) $oHTTP.Send() If $iError Then Return SetError(2, 0, 0) Local $sDate = $oHTTP.GetResponseHeader("Date") Local $sYear = StringRegExpReplace($sDate, ".+,\s*\d+\s*\w+\s*(20\d+)\s*.*", "$1") Local $iMonth, $aMonth[13] = [12, "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dez"] $iMonth = _ArraySearch($aMonth, StringRegExpReplace($sDate, ".+,\s*\d+\s*(\w+)\s*20\d+\s*.*", "$1")) Local $iDay, $aDay[8] = [7, "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"] $iDay = StringRegExpReplace($sDate, ".+,\s*(\d+)\s*\w+\s*20\d+\s*.*", "$1") $oHTTP = Null Local $aDate[3] = [$sYear, StringFormat("%02i", $iMonth), StringFormat("%02i", $iDay)] Return $aDate EndFunc Func ObjErrChk() $iError += 1 ConsoleWrite($oErrorChk.scriptline & @CRLF) ConsoleWrite($oErrorChk.windescription & @CRLF) ConsoleWrite($oErrorChk.number & " / " & Hex($oErrorChk.number) & @CRLF) EndFunc
    1 point
  12. MHz

    Combine variable name

    Eval takes an expression. This means a string is acceptable rather then an actual variable. Example Local $abc1 = 2 Local $abc2 = 3 Local $abc3 = 4 For $1 = 1 To 3 MsgBox(0, $1, Eval('abc' & $1)) Next All 3 variables are shown in the loop by using the expression of 'abc' & $1
    1 point
  13. supersonic, Would Sir like fries with this? #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ListViewConstants.au3> #Include <GuiListView.au3> Global $iColumns = 3, $sHeader = "This header is longer than the items| | ", $iScroll_Allowance = 0 Global $aData[5] = ["1|1|1", "2|2222222222222|2", "33333333|3333|33333333333333", "4|444444444444444444444444444|4", "5|5|5"] Global $iGUI_Width = 500, $iGUI_Height = 200 ; Create GUI at initial size Global $hGUI = GUICreate("Test", $iGUI_Width, $iGUI_Height) ; Create List View at initial size Global $hListView = GUICtrlCreateListView($sHeader, 10, 10, $iGUI_Width - 20, $iGUI_Height - 20, $LVS_SHOWSELALWAYS, BitOR($LVS_EX_FULLROWSELECT, $WS_EX_CLIENTEDGE)) ; Add data For $i = 0 To UBound($aData) - 1 GUICtrlCreateListViewItem($aData[$i], $hListView) Next ; Scroll down to ensure final item visible _GUICtrlListView_EnsureVisible($hListView, UBound($aData) - 1) ; Check top index - if not 0 then we have a scroll bar so increase ListView width If _GUICtrlListView_GetTopIndex($hListView) > 0 Then $iScroll_Allowance = 17 EndIf ; Scroll to top again _GUICtrlListView_EnsureVisible($hListView, 0) ; Determine ListView width $iLV_Width = $iScroll_Allowance For $i = 0 To $iColumns - 1 ; Size column to fit header _GUICtrlListView_SetColumnWidth($hListView, $i, $LVSCW_AUTOSIZE_USEHEADER) $iHeader_Width = _GUICtrlListView_GetColumnWidth($hListView, $i) ; Now size column to fit data _GUICtrlListView_SetColumnWidth($hListView, $i, $LVSCW_AUTOSIZE) $iData_Width = _GUICtrlListView_GetColumnWidth($hListView, $i) ; If header is wider, reset width If $iHeader_Width > $iData_Width Then _GUICtrlListView_SetColumnWidth($hListView, $i, $iHeader_Width) $iLV_Width += $iHeader_Width Else $iLV_Width += $iData_Width EndIf Next ; Resize ListView and GUI to fit data ControlMove($hGUI, "", $hListView, 10, 10, $iLV_Width + 10, $iGUI_Height - 20) ; Add 10 for internal ListView borders WinMove($hGUI, "", Default, Default, $iLV_Width + 30) ; Add 30 for internal ListView and external GUI borders GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndI have used _GUICtrlListView functions when we set the column width to make it easier to follow - all they do is wrap the GUICtrlSendMsg commands we used before. M23
    1 point
  14. Ascend4nt

    Open Explorer

    Even better, select the file or folder you want. Example: Run("explorer.exe /n,/e,/select,C:\Windows\notepad.exe")
    1 point
×
×
  • Create New...