Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/11/2019 in all areas

  1. #include <Array.au3> Global $arrResult[0][2], $strString = "Customer Name* : NAME" & @CRLF & _ "Customer Account Number* : 12345678910" & @CRLF & _ "Customer Phone Number* : 555-867-5309" & @CRLF & _ "Address* : 123 Fake Street" & @CRLF & _ "City* : Townsville" & @CRLF & _ "State* : NY" & @CRLF & _ "Zip Code* : 12345" _ArrayAdd($arrResult, $strString, 0, ":") _ArrayDisplay($arrResult)
    3 points
  2. water

    OutlookTools

    Version 0.6.0.0

    1,294 downloads

    Built on top of the OutlookEX UDF it offers some often needed extended functionality (import/export ics/vcf/csv files etc.) (former name: iCal UDF). Note: This is a beta version - script breaking changes may occur at any time! Prerequisite: OutlookEX UDF. Details about all functions can be found in the Wiki. ICS (iCalendar) import - Import iCal events from an ICS file to an Outlook calendar VCF (vCard) import - Import vCard contacts to an Outlook contacts folder CSV import - Import data from a CSV file and create Outlook items in a specified folder Export - Export Outlook items (contacts, appointments) in VCF, ICS, CSV or Excel format Links: https://tools.ietf.org/html/rfc5545 (ICS - iCalendar) https://tools.ietf.org/html/rfc6350 (VCF - vCard) Threads: General Help & Support Known Bugs: (last changed: 2019-01-22) None Things to come: (last changed: 2022-01-25) Support for EML mails (email contents as plain text in MIME format) will be added BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort
    1 point
  3. Inpho

    AutoIt Snippets

    I use these daily; thought I'd share. Don't use this version, updated one is below #AutoIt3Wrapper_Au3Check_Parameters=-d -w- 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include-once #include <Date.au3> ; #FUNCTION# ==================================================================================================================== ; Name ..........: _StringRandom ; Description ...: Returns a string of random characters ; Syntax ........: _StringRandom($iAmount[, $iType = 1]) ; Parameters ....: $iAmount - an integer value. Length of returned string ; $iType - [optional] an integer value. Default is 1. ; 1 - Return digits (0 - 9) ; 2 - Return hexadecimal (0 - 9, A - F) ; 3 - Return Alphanumeric upper (0 - 9, A - Z) ; 4 - Return Alphanumeric (0 - 9, A - Z, a - z) ; 5 - Return Alpha upper (A - Z) ; 6 - Return Alpha (A - Z, a - z) ; Return values .: Success - String ; Failure - Empty string and @error flag as follows: ; @error : 1 - $iAmount is not a positive integer ; 2 - $iType is out of bounds ; Author ........: Sam Coates ; =============================================================================================================================== Func _StringRandom($iAmount, $iType = 1) If $iAmount < 1 Or IsInt($iAmount) = 0 Then Return(SetError(-1, 0, "")) Local $sString = "" Local $iRandom = 0, $iRandomLow = 1, $iRandomHigh = 62 Local $aCharId[63] If $iType = 1 Then ;; digits: 1 - 10 $iRandomHigh = 10 ElseIf $iType = 2 Then ;; hexadecimal: 1 - 16 $iRandomHigh = 16 ElseIf $iType = 3 Then ;; alnumupper: 1 - 36 $iRandomHigh = 36 ElseIf $iType = 4 Then ;; alnum: 1 - 62 $iRandomHigh = 62 ElseIf $iType = 5 Then ;; alphaupper: 11 - 36 $iRandomLow = 11 $iRandomHigh = 36 ElseIf $iType = 6 Then ;; alpha: 11 = 62 $iRandomLow = 11 $iRandomHigh = 62 Else Return(SetError(-2, 0, "")) EndIf For $i = 1 To 10 ;; loop through our array, assigning ascii values to each element $aCharId[$i] = Chr(47 + $i) Next For $i = 11 to 36 $aCharId[$i] = Chr(54 + $i) Next For $i = 37 To 62 $aCharId[$i] = Chr(60 + $i) Next For $i = 1 To $iAmount $iRandom = Random($iRandomLow, $iRandomHigh, 1) ;; random interger between $iRandomLow and $iRandomHigh $sString &= $aCharId[$iRandom] ;; append string with corresponding character from ascii array Next Return ($sString) EndFunc ; #FUNCTION# ==================================================================================================================== ; Name ..........: _StringTrimLeft ; Description ...: Searches for a string inside a string, then removes everything on the left of that string ; Syntax ........: _StringTrimLeft($sString, $sRemove[, $iCaseSense = 0, $iOccurrence = 1]) ; Parameters ....: $sString - a string value. The string to search inside. ; $sRemove - a string value. The string to search for. ; $iCaseSense - an integer value. Flag to indicate if the operations should be case sensitive. ; $iOccurrence - an integer value. Which occurrence of the substring to find in the string. Use a ; negative occurrence to search from the right side. ; Return values .: Success - String ; Failure - Empty string as returned from StringTrimLeft() ; Author ........: Sam Coates ; =============================================================================================================================== Func _StringTrimLeft($sString, $sRemove, $iCaseSense = 0, $iOccurrence = 1) Local $sReturn = StringTrimLeft($sString, StringInStr($sString, $sRemove, $iCaseSense, $iOccurrence) + StringLen($sRemove) - 1) Return ($sReturn) EndFunc ;==>_StringTrimLeft ; #FUNCTION# ==================================================================================================================== ; Name ..........: _StringLeft ; Description ...: Searches for a string inside a string, then removes everything on the right of that string ; Syntax ........: _StringLeft($sString, $sRemove[, $iCaseSense = 0, $iOccurrence = 1]) ; Parameters ....: $sString - a string value. The string to search inside. ; $sRemove - a string value. The string to search for. ; $iCaseSense - an integer value. Flag to indicate if the operations should be case sensitive. ; $iOccurrence - an integer value. Which occurrence of the substring to find in the string. Use a ; negative occurrence to search from the right side. ; Return values .: Success - String ; Failure - Empty string as returned from StringLeft() ; Author ........: Sam Coates ; =============================================================================================================================== Func _StringLeft($sString, $sRemove, $iCaseSense = 0, $iOccurrence = 1) Local $sReturn = StringLeft($sString, StringInStr($sString, $sRemove, $iCaseSense, $iOccurrence) - 1) Return ($sReturn) EndFunc ;==>_StringLeft ; #FUNCTION# ==================================================================================================================== ; Name ..........: _FileToFileName ; Description ...: Returns a filename from a FQPN (Fully Qualified Path Name) ; Syntax ........: _FileToFileName($sPath[, $bIncludeExtension = True]) ; Parameters ....: $sPath - a string value. ; $bIncludeExtension - [optional] a boolean value. Default is True. ; Return values .: Success - String ; Failure - Empty string as returned from StringLeft() ; Author ........: Sam Coates ; =============================================================================================================================== Func _FileToFileName($sPath, $bIncludeExtension = True) Local $sReturn = StringTrimLeft($sPath, StringInStr($sPath, "\", 0, -1)) If $bIncludeExtension = False Then $sReturn = StringLeft($sReturn, StringInStr($sReturn, ".", 0, -1) - 1) Return ($sReturn) EndFunc ;==>_FileToFileName ; #FUNCTION# ==================================================================================================================== ; Name ..........: _FileToFilePath ; Description ...: Returns a folder path from a FQPN (Fully Qualified Path Name) ; Syntax ........: _FileToFilePath($sPath) ; Parameters ....: $sPath - a string value. ; Return values .: Success - String ; Failure - Empty string as returned from StringLeft() ; Author ........: Sam Coates ; =============================================================================================================================== Func _FileToFilePath($sPath) Local $sReturn = StringLeft($sPath, StringInStr($sPath, "\", 0, -1) - 1) Return ($sReturn) EndFunc ;==>_FileToFilePath ; #FUNCTION# ==================================================================================================================== ; Name ..........: _FileToFileExtension ; Description ...: Returns a file extension from a filename/FQPN (Fully Qualified Path Name) ; Syntax ........: _FileToFileExtension($sPath) ; Parameters ....: $sPath - a string value. ; Return values .: Success - String ; Failure - Empty string as returned from StringTrimLeft() ; Author ........: Sam Coates ; =============================================================================================================================== Func _FileToFileExtension($sPath) Return (StringTrimLeft($sPath, StringInStr($sPath, ".", 0, -1))) EndFunc ;==>_FileToFileExtension ; #FUNCTION# ==================================================================================================================== ; Name ..........: _DateTimeGet ; Description ...: Returns the date and time formatted for use in sortable filenames, logs, listviews, etc. ; Syntax ........: _DateTimeGet(iType = 1[, $bHumanFormat = False]) ; Parameters ....: $iType - [optional] an integer value. Default is 1. ; 1 - Date and time in file-friendly format; 20190115_113756 ; 2 - Date in file-friendly format; 20190115 ; 3 - Time in file friendly format; 113756 ; $bHumanFormat - [optional] a boolean value. Default is False. ; True - Includes slashes in the date and colons in the time with a space inbetween ; False - No slashes or colons included with an underscore inbetween ; Return values .: Success - String ; Failure - Sets @error to non-zero and returns an empty string ; Author ........: Sam Coates ; =============================================================================================================================== Func _DateTimeGet($iType = 1, $bHumanFormat = False) If $iType < 1 Or $iType > 3 Then Return(SetError(-1, 0, "")) ;; Param1: ;; 1 = Date and time in file friendly format: 20190115_113756 ;; 2 = Date in file friendly format: 20190115 ;; 3 = Time in file friendly format: 113756 ;; Param2: ;; True = Use human-readable format: 15/01/2019 11:37:56 Local $sTime = _NowTime() Local $sDate = _NowDate() If $iType = 1 Then If $bHumanFormat = False Then $sTime = StringReplace($sTime, ":", "") $sDate = StringReplace($sDate, "/", "") $sDate = StringTrimLeft($sDate, 4) & StringMid($sDate, 3, 2) & StringLeft($sDate, 2) Return ($sDate & "_" & $sTime) Else Return ($sDate & " " & $sTime) EndIf ElseIf $iType = 2 Then If $bHumanFormat = False Then $sDate = StringReplace($sDate, "/", "") $sDate = StringTrimLeft($sDate, 4) & StringMid($sDate, 3, 2) & StringLeft($sDate, 2) EndIf Return ($sDate) ElseIf $iType = 3 Then If $bHumanFormat = False Then $sTime = StringReplace($sTime, "/", "") EndIf Return ($sTime) EndIf EndFunc ;==>_DateTimeGet EDIT: I have no idea why I claim digits are 1 - 10 instead of 0 - 9... Excuse my brainfart. Amended.
    1 point
  4. Credits to jchd for having enlighten my knowledge on this one #Include <Array.au3> Local $examplelines = '<input type="checkbox" id="route0" name="route0" checked></td><td>1.1.1.1</td><td>2.2.2.2</td><td>3.3.3.3</td>' & @crlf & _ '<input type="checkbox" id="route1" name="route1" ></td><td>4.4.4.4</td><td>5.5.5.5</td><td>6.6.6.6</td>' & @crlf & _ '<input type="checkbox" id="route2" name="route2" checked></td><td>7.7.7.7</td><td>8.8.8.8</td><td>9.9.9.9</td>' Local $s = Execute(StringRegExpReplace($examplelines, _ '(?m)^.*name="([^"]+)"\h*(\w*).*?<td>([^<]*)</td><td>([^<]*)</td><td>([^<]*)</td>(\R?)', _ "''" & " & '$1|' & " & "('$2'='checked') & " & "'|$3|$4|$5' & '$6' & ") & "''") Local $a[0][5] _ArrayAdd($a, $s) _ArrayDisplay($a)
    1 point
  5. You may need to adjust the delay between keystrokes. See SendKeyDelay setting here.
    1 point
×
×
  • Create New...