Leaderboard
Popular Content
Showing content with the highest reputation on 02/26/2019 in all areas
-
You can use something like: #include <AD.au3> #include <Array.au3> #include <String.au3> ;~ Open Connection to the Active Directory _AD_Open() If @error Then Exit MsgBox(16, "Active Directory Example Skript", "Function _AD_Open encountered a problem. @error = " & @error & ", @extended = " & @extended) Global $aProperties, $sUserNTID, $sUserFirstName, $sUserLastName, $sUserEmail, $sUserContractorID, $sMngrFQDN, $aMngrProperties, $sMngrFirstName, $sMngrLastName, $sMngrEmail, $sMngrPhone Global $sUserName = InputBox("Get user's manager","Input user ID: ") Global $bUserName = _AD_ObjectExists($sUserName,"") If $bUserName = 0 Then MsgBox(0,"","User not found: " & $sUserName) Else $aUserProperties = _AD_GetObjectProperties($sUserName,"cn,displayName,givenName,sn,mail,ComcastContractorID,Manager") If @error Then MsgBox(4096, "_AD_GetObjectProperties Error", "Error getting _AD_GetObjectProperties for " & $sUserEmail) _AD_Close() EndIf For $i = 1 To $aUserProperties[0][0] Switch $aUserProperties[$i][0] Case "cn" $sUserNTID = $aUserProperties[$i][1] Case "givenName" $sUserFirstName = $aUserProperties[$i][1] Case "sn" $sUserLastName = $aUserProperties[$i][1] Case "mail" $sUserEmail = $aUserProperties[$i][1] Case "manager" $sMngrFQDN = _AD_FQDNToSamAccountName($aUserProperties[$i][1]) If @error Then ContinueLoop $aMngrProperties = _AD_GetObjectProperties($sMngrFQDN, "givenName,sn,mail,telephoneNumber") If @error Then ContinueLoop For $j = 1 To $aMngrProperties[0][0] Switch $aMngrProperties[$j][0] Case "givenName" $sMngrFirstName = $aMngrProperties[$j][1] Case "sn" $sMngrLastName = $aMngrProperties[$j][1] Case "mail" $sMngrEmail = $aMngrProperties[$j][1] Case "telephoneNumber" $sMngrPhone = $aMngrProperties[$j][1] EndSwitch Next Case "ComcastContractorID" $sUserContractorID = $aUserProperties[$i][1] EndSwitch Next ;~ Display user and manager details MsgBox(0,"CONTRACTOR DETAILS","USER INFO:" & @LF & "NT ID: " & $sUserNTID & @LF & "Full Name: " & $sUserFirstName & " " & $sUserLastName & @LF & "Email Address: " & $sUserEmail & @LF & "CPERNR: " & $sUserContractorID & @LF & @LF & "USERS MANAGER INFO" & @LF & "Name: " & $sMngrFirstName & " " & $sMngrLastName & @LF & "Email Address: " & $sMngrEmail & @LF & "Telephone #: " & $sMngrPhone) EndIf _AD_Close()2 points
-
Create PDF from your application
felix12123 reacted to taietel for a topic
If you look to output PDF's from your application (generate reports, graphics, tables etc), this UDF can be very useful. In the zip file are examples, images for testing and the UDF. Enjoy! I have removed some of the previous versions due to the lack of space, but they are still available on request. [uPDATED June 22] v.1.0.1 Added more page formats, two more fonts, example table ... [uPDATED July 30] v1.0.2 Solved issues with Adobe Reader. StuffByDennis added two more functions (Thanks Dennis). [uPDATED August 10] v1.0.3 Rewrote entirely _LoadResImage function - optimize for speed/size of the pdf. Fixed the Example_Image2PDF Thanks to xavierh for finding a missing space in the _LoadFontTT function (even it looks insignificant, that solved an issue with text justification when using Adobe Reader, not Foxit Reader) Total downloads old versions: 2044 + 21 Version 1.0.3: MPDFv103.zip1 point -
CSV UDF - a UDF for manipulating CSV files
mLipok reacted to seangriffin for a topic
This UDF provides functions for editing CSV files. It uses the features of SQLite already existing within AutoIT to open, edit and save data in the CSV format. Because SQLite is used the performance of the UDF is fast and the functions are accurate. REQUIREMENTS: Windows 64-bit (not tested under Windows 32-bit) AutoIt3 3.3 or higher sqlite3.exe (included) sqlite3.dll (included) LIST OF FUNCTIONS: EXAMPLES: Note - To make this example work, you must make sure sqlite3.exe, sqlite3.dll and Item.csv are present in the same folder as the examples. #include-once #include "CSV.au3" ConsoleWrite(@CRLF & "Initialise the CSV handler ... ") _CSV_Initialise() ConsoleWrite("Done." & @CRLF) ConsoleWrite(@CRLF & "Open the CSV file 'Item.csv' ... ") Local $item_csv_handle = _CSV_Open("Item.csv") ConsoleWrite("Done." & @CRLF) ConsoleWrite(@CRLF & "Delete all CSV records with an 'Assigned to' value of 'DELI_SIT_S0003' ... ") _CSV_Exec($item_csv_handle, "delete from csv where `Assigned to` = 'DELI_SIT_S0003';") ConsoleWrite("Done." & @CRLF) ConsoleWrite(@CRLF & "Get all CSV records with the header and display the result ..." & @CRLF & @CRLF) Local $csv_result = _CSV_GetRecordArray($item_csv_handle, "", True) _CSV_DisplayArrayResult($csv_result) ConsoleWrite(@CRLF & "Get the first CSV record without the header and display the result ..." & @CRLF & @CRLF) Local $csv_result = _CSV_GetRecordArray($item_csv_handle, 1, False) _CSV_DisplayArrayResult($csv_result) ConsoleWrite(@CRLF & "Get all CSV records with an 'Assigned to' value of 'DELI_SIT_S0004' and display the result ..." & @CRLF & @CRLF) Local $csv_result = _CSV_GetRecordArray($item_csv_handle, "select * from csv where `Assigned to` = 'DELI_SIT_S0004';", False) _CSV_DisplayArrayResult($csv_result) ConsoleWrite(@CRLF & "Get a count of the number of records in the CSV file ... ") Local $number_of_records = _CSV_GetRecordCount($item_csv_handle) ConsoleWrite("There are " & $number_of_records & " records in the CSV." & @CRLF) ConsoleWrite(@CRLF & "Save the entire CSV file as 'Item complete.csv' ... ") _CSV_SaveAs($item_csv_handle, "Item complete.csv") ConsoleWrite("Done." & @CRLF) ConsoleWrite(@CRLF & "Sort and Save the entire CSV file as 'Item sorted.csv' ... ") _CSV_SaveAs($item_csv_handle, "Item sorted.csv", "select * from csv order by `Assigned to`, `Comment 1`;") ConsoleWrite("Done." & @CRLF) ConsoleWrite(@CRLF & "Query records with an 'Assigned to' value of 'DELI_SIT_S0004' and Save as 'Item DELI_SIT_S0004.csv' ... ") _CSV_SaveAs($item_csv_handle, "Item DELI_SIT_S0004.csv", "select * from csv where `Assigned to` = 'DELI_SIT_S0004';") ConsoleWrite("Done." & @CRLF) ConsoleWrite(@CRLF & "Cleanup the CSV handler ... ") _CSV_Cleanup() ConsoleWrite("Done." & @CRLF) DOWNLOAD: Source: https://github.com/seanhaydongriffin/CSV-UDF1 point -
Create PDF from your application
FrancescoDiMuro reacted to Gianni for a topic
an easy fix: just add the following snippet at the bottom of the MPDF_UDF.au3 ; by @zedna ; https://www.autoitscript.com/forum/topic/118827-create-pdf-from-your-application/?do=findComment&comment=1192000 Func _Iif($fTest, $vTrueVal, $vFalseVal) If $fTest Then Return $vTrueVal Else Return $vFalseVal EndIf EndFunc ;==>_Iif1 point -
Hi careca, this works as expected. Looks like there's something wrong with MouseOnEvent.au3 - maybe only in this example/case!? Now I'll need some time to figure out, what you've done an how it works Thanks for your response kara20041 point
-
Basically I was wondering how HotKeySet works to disable the sound so I could replicate it, but it's all good, I'll just edit the registry on boot.1 point
-
AutoIT and PowerShell/Python
LarsJ reacted to Earthshine for a topic
poorly written code is always hard to understand. I would use Pandas parser in Python. there are so many but that is a really fast one. check this article out https://www.vipinajayakumar.com/parsing-text-with-python/#parsing-text-in-standard-format and this is the way to parse in general in Python with open('yourfile.csv') as f: for line in f: print('lines'+line) you could write functions that do all the searches, and use Regular Expressions to speed it up still, it won't match C though, but that link junkew posted above could be just what you want.1 point -
1 point
-
@LukeLe I may have misremembered, though might be a good feature request for ISN Form Studio1 point
-
Silently removing leading zeroes may permanently destroy data, never do that in the general case. Leading zeroes are semantically significant in an unbounded number of situations: James is "007", not "7" and 13-digit barcode "0000870361925" may designate a completely distinct item from "870361925".1 point
-
It did in my testing. Here's the complete code -- #include "wd_core.au3" Local $sDesiredCapabilities $_WD_DEBUG = False SetupChrome() _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://www.88countryclub.co.kr/") $hwnd = WinWaitActive("88") WinSetState($hwnd, "", @SW_MAXIMIZE) Sleep(1000) ControlSend($hwnd, "", "", "^f") Func SetupChrome() _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--log-path=' & @ScriptDir & '\chrome.log') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"chromeOptions": {"w3c": true }}}}' EndFunc1 point
-
1 point