Leaderboard
Popular Content
Showing content with the highest reputation on 04/28/2017 in all areas
-
Back to my roots- Thank you AutoIT Community!
Realm and 2 others reacted to QuickWhiteWolf for a topic
Hi everyone, I was previously a member of this forum under the username Wombat. It's been years and multiple email accounts closed since then so I decided to start fresh and take a moment to thank you all... (Admins/Mods let me know if we need to discuss this...) I started programming with AutoIT while working as a scrap catcher for a machine that chopped scrap into pieces for easier moving, I learned styles and gained strengths from some of the best members on this forum by reverse engineering their code. I gained the confidence of our IT manager by making a boast that I could write an application to replace a p.o.s. cobalt based app we were using on the floor at that time, needless to say I was way in over my head but he saw that I had potential and I luckily had built several other apps on the side that were of equal or greater value to the company. I've been working as help-desk for the past 3 years and writing software as well to facilitate the help desk and solve recurring issues with our users. I was given an office and moved out of help-desk about a year ago, after 5 years of hard work I've actually landed the title of Jr. Developer moving into mid level title/pay this year! The company has already set out an improvement path that sees me with 4 certs and a bachelors in 4 more years making great money. Before this I had only ever worked at gas stations, fast food and manual labor jobs. If you're ever worried about your life, want something more, or just want a change you can do it. It's not easy, not at all, but it's possible and software programming is a very rewarding field if you like to make things and see how others interact with them. I utilized AutoIT to bring a company into the twenty-first century, away from paper trails and sticky notes improving the quality of life for the employees on the floor (where I started before learning AutoIT). I was given the go ahead to purchase visual studio and I learned VB.Net and built an awesome piece of Zebra labeling software (Utilizing ZPL code translated froma graphical editor) for our shipping department. Now I'm diving head first into C# and we have another programmer on board as we move on to MS Team Services and begin to tackle a sweet new project involving real time awareness of our product on the factory floor utilizing RFID and windows 10 tablets. That's a long way to come in just 4 years, and I couldn't have done it without the gigantic heart this community has and the mentorship provided for people looking to get into programming. So from the bottom of my heart, with immense respect.... Thank you so much AutoIT community3 points -
2 points
-
I was needing to create a quick GUI and what better language to do it in! What was meant to be quick turned into getting lost in code... yes, we've all been there. I was tired of positioning each of the controls within my container GUIs so I started writing a pad function. I realized that ControlGetPos wasn't returning what I had expected for the control relative to its parent, but from the ancestor. The _hwnd_GetPos() is something I had written in another language that I just translated to here. ; #FUNCTION# ==================================================================================================================== ; Author ........: SmOke_N ; Modified.......: ; =============================================================================================================================== #include-once #include <WinAPI.au3> Func _hwnd_GetPos($hWnd, $hParent = 0) $hParent = IsHWnd($hParent) ? $hParent: _WinAPI_GetParent($hWnd) Local $tPoint = DllStructCreate("int x;int y") Local $tRect = _WinAPI_GetWindowRect($hWnd) DllStructSetData($tPoint, "x", DllStructGetData($tRect, "left")) DllStructSetData($tPoint, "y", DllStructGetData($tRect, "top")) _WinAPI_ScreenToClient($hParent, $tPoint) Local $aData[4] = [ _ DllStructGetData($tPoint, "x"), _ DllStructGetData($tPoint, "y"), _ DllStructGetData($tRect, "right") - DllStructGetData($tRect, "left"), _ DllStructGetData($tRect, "bottom") - DllStructGetData($tRect, "top")] Return $aData EndFunc Then I get to the combo commands and realize there's no autocomplete for _GUIComboBoxEx_* (but I did see it on the todo list in the include file). Anyway, here's one to work with the Ex include (it's been a while since working with regex, almost switched to a for/next loop lol). Edit: Forgot about the AutoIt Snippets thread... moving things there! ; #FUNCTION# ==================================================================================================================== ; Author ........: SmOke_N ; Modified.......: ; =============================================================================================================================== #include-once #include <GUIComboBoxEx.au3> #include <GUIEdit.au3> Func _GUICtrlComboBoxEx_AutoComplete($hWnd) If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd) If Not __GUICtrlComboBox_IsPressed('08') And Not __GUICtrlComboBox_IsPressed("2E") Then ;backspace pressed or Del Local $hEXEdit = HWnd(_SendMessage($hWnd, $CBEM_GETEDITCONTROL)) Local $sEditText = _GUICtrlEdit_GetText($hEXEdit) If StringLen($sEditText) Then Local $sList = _GUICtrlComboBoxEx_GetList($hWnd) Local $sDelim = "\" & Opt("GUIDataSeparatorChar") Local $aStr = StringRegExp($sList, "(?si)(?:^|" & $sDelim & ")(" & _ $sEditText & ".*?)(?:\z|" & $sDelim & ")", 1) If IsArray($aStr) Then _GUICtrlEdit_SetText($hEXEdit, $aStr[0]) _GUICtrlEdit_SetSel($hEXEdit, StringLen($sEditText), StringLen($aStr[0])) EndIf EndIf EndIf EndFunc ;==>_GUICtrlComboBoxEx_AutoComplete2 points
-
I appreciate the quick response! Unfortunately, this did not break the loop, as it runs whichever function about 10-20 times a second. I had used Switch in this script in the iteration before I involved a radio and it worked beautifully. Clearly I broke it. Update: Actually, you had the right of it, Kudos! I forgot to comment out the non-working part of the text. Once removed, the above worked as explained! Gracias!1 point
-
You can make it really dynamic by using a dictionary object to store the lisbox handles instead of an array: ; Create dictionary object $oListboxDict = ObjCreate( "Scripting.Dictionary" ) ; Add listboxes to $oListboxDict $oListboxDict( $ListboxHandle11 ) = 1 $oListboxDict( $ListboxHandle12 ) = 1 $oListboxDict( $ListboxHandle13 ) = 1 $oListboxDict( $ListboxHandle14 ) = 1 $oListboxDict( $ListboxHandle15 ) = 1 ; In _WM_COMMAND use an If ... EndIf instead of a Switch ... EndSwitch If $oListboxDict.Exists( $hWndFrom ) Then ... ... ... EndIf Here you do not need a loop in _WM_COMMAND function.1 point
-
To erase all duplicate rows except keep the last duplicate row, try:- #include <Array.au3> #include 'ArrayWorkshop.au3' Local $aArray[100][6] = [["A", "B", "C", "D", "E", "F"], _ ["A", "B", "C", "D", "E", "XXX"], _ ["A", "B", "C", "D", "E", "F"], _ ["1", "2", "3", "4", "5", "6"], _ ["A", "B", "C", "D", "E", "F"], _ ["A", "B", "C", "QQ", "E", "F"], _ ["A", "B", "C", "D", "E", "XXX"], _ ["", "1", "", "", "3", ""], _ ["1", "3", "", "", "", ""], _ ["", "", "", "", "", ""]] _ReverseArray($aArray) _ArrayUniqueXD($aArray) _ReverseArray($aArray) _ArrayDisplay($aArray)1 point
-
[Solved] _IE unable to find or read obj
FengHuangWuShen reacted to Subz for a topic
Sorry meant _IEAttach, can you try this code: Local _IEAttach("<Partial URL>", "url") Local $oFrame = _IEGetObjById($IE, "mainBody") Local $oMainBody = $oFrame.contentWindow ConsoleWrite('Message - ' & $oMainBody.document.GetElementbyId("pageHeaderTitle").innertext)1 point -
selecting items in Set Default Programs
argumentum reacted to JLogan3o13 for a topic
You seem to have missed the point of the OP's question. He is looking for a way to bring up the default programs list, and then select specific ones by text rather than index.1 point -
you have to use strings, not numbers, try with replacestring as "4" instead of the number 4: $ExampleText = "123456789" $Replacedtext = StringReplace($ExampleText, "4", "") ConsoleWrite($Replacedtext & @crlf) edit: P.S. jchd correctly assumes you want to use the second parameter as "start point" method, as it seems from your example, but I think that you just want replace the substring "4" with nothing (just removing it)1 point
-
UDF Add fail in SciTe
SorryButImaNewbie reacted to Subz for a topic
Is UIAWrappers.au3 in the D:\AutoIT\ExtraUDF folder?1 point -
As the help says: " If the start method is used the occurrence and casesense parameters are ignored. The function will replace the characters in "string", starting at the requested position, with the characters in "replacestring" - as many characters will be replaced as are in "replacestring". However, if there are not enough characters in "string" for the entire "replacestring" to be inserted an empty string is returned and @error is set to 1. " In your example, "replacestring" has length zero, hence zero characters are replaced.1 point
-
Autoit MouseClick Problems
Xandy reacted to KickStarter15 for a topic
@JLogan3o13, I have attached snippet of what I mean. This prompting issue is because of some security check if the program should be run from the server or not (I think this is basic security check for a certain company that involving application and software). If the .exe file was path in your local then ShellExecute() is running smoothly but if it involved server base, then there is confirmation prompted. Sorry I need to shade the path from that prompting, it's confidential. But, if we use Run() from that code, then this confirmation will not prompt (Tested).1 point -
As explained in the help file for _FileReadToArray, the stringsplit algorithm in the function is limited. Use one of the many CSV functions that you can find in the Examples forum. For example this one;1 point
-
If you have Excel you could just change the extension to .csv and it will create the array correctly. #include <Array.au3> #include <Excel.au3> Local $sFilePath = @ScriptDir & "\NotWorking.csv" Local $oExcel = _Excel_Open(False) Local $oWorkBook = _Excel_BookOpen($oExcel, $sFilePath) Local $aWorkBook = _Excel_RangeRead($oWorkBook) _Excel_BookClose($oWorkBook) _Excel_Close($oExcel) _ArrayDisplay($aWorkBook, "Before") For $i = 0 To UBound($aWorkBook) - 1 $aWorkBook[$i][5] = StringReplace($aWorkBook[$i][5], ",", "") Next _ArrayDisplay($aWorkBook, "After")1 point
-
InaN1990, Are you sure that you don't have a blank line at the start or end? Can you post the file that you are using? kylomas edit: You might try a simple script to run through each line and counts the commas per line. Stringreplace give you a count of the number of replacements.1 point
-
how to resolve NPF.ini error message
argumentum reacted to JLogan3o13 for a topic
The error is on line 46 In all seriousness, though, how are we to help you troubleshoot without any code?1 point -
thankz i think i find a problem , is one path have not @_scriptdir but relative path wrong1 point
-
You're clearly confusing the string "46FCE66694E66D1712" and the binary value Binary("0x46FCE66694E66D1712"). Try by yourself: #Include "Base64.au3" Local $Data = Binary("0x46FCE66694E66D1712") ;~ Local $Data = BinaryToString(StringToBinary("The quick brown fox jumps over the lazy ɖɘɠɥლოჸᴟ⁈ℕℤℚℝℂℍℙ∑∀∋≢≰⋟⋞⟪⟫ dog", 4), 1) Local $Encode = _Base64Encode($Data) MsgBox(0, 'Base64 Encode Data', $Encode) Local $Decode = _Base64Decode($Encode) MsgBox(0, 'Base64 Decode Data (Binary Format)', $Decode)1 point
-
iiyama, Just set your own format for the picker: #include <GUIConstantsEx.au3> #include <DateTimeConstants.au3> Local $n, $msg GUICreate("My GUI get time", 200, 200, 800, 200) $n = GUICtrlCreateDate("", 20, 20, 100, 20) GUICtrlSendMsg($n, 0x1032, 0, "HH:mm") ; $DTM_SETFORMATW GUISetState() ; Run the GUI until the dialog is closed Do $msg = GUIGetMsg() Until $msg = $GUI_EVENT_CLOSE MsgBox(0, "Time", GUICtrlRead($n)) GUIDelete() M231 point