Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/21/2017 in all areas

  1. The RE pattern means when there is a "/" at the end of a line then replace the "/" character with "", nothing (delete it). $sFileName = "\\poop\IC3.txt" ; FileToWorkOn MsgBox(0, "", StringRegExpReplace(FileRead($sFileName), "(?m)/*$", "")) ; See StringRegExp() in AutoIt help to lookup meaning of regular expression's pattern.
    1 point
  2. I miss my old Focus FK-5001. Nice heavy touch. Mechanical click. Dual sets of macro programmable (no software needed) function keys. A real programmers keyboard. --snif-- Why did they have to move away from the 5-pin DIN connector? --snif--
    1 point
  3. I don't quite understand what you are trying to do. If you want to rename your files, you could use FileMove, for both Files and Directories.
    1 point
  4. Look at using FileMove. From the help file. Adam
    1 point
  5. See post #160 in this thread, VirusTotal is a joke and completely unreliable. Stop flogging the dead horse, it's not going to rise from the dead.
    1 point
  6. Hello Mr. zenocon and welcome to our forums. The "AutoIt Window Info" tool generally detects standard Windows controls in the Control Library, but has only very limited support for Windows Forms controls in .NET Framework. The idea of enumerating the child windows will not really help. The controls are still Windows Forms controls and "AutoIt Window Info" tool will probably not give much information. That some kind of 3rd party code is the reason why you cannot identify the controls is unlikely. The reason is simply the "AutoIt Window Info" tool's lack of support for these controls. The best chance to identify the controls is the UI Automation framework and the "Simple spy tool". Microsoft's answer to this tool is Inspect.exe which is included in the Windows SDK. You can also download a copy in this post.
    1 point
  7. I ran into a problem as the title says. #include <AutoItConstants.au3> $Run = Run("cmd.exe" & " /c " & "net stop wuauserv",@SystemDir,@SW_HIDE,$STDOUT_CHILD) ProcessWaitClose($Run) $Output = StdoutRead($Run) MsgBox(0,'',$Output)
    1 point
  8. Why not use example in help file!!?? #include <AutoItConstants.au3> Local $line Local $Run = Run("cmd.exe" & " /c " & "net stop wuauserv", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) While 1 $line &= StdoutRead($Run) If @error Then ExitLoop WEnd MsgBox(0, "STDOUT read:", $line) $Line = "" While 1 $line &= StderrRead($Run) If @error Then ExitLoop WEnd MsgBox(0, "STDERR read:", $line)
    1 point
  9. Did you also replace $STDOUT_CHILD with $STDERR_CHILD ?
    1 point
  10. Chrome has a built-in task viewer and it will show you what all those instances are for. Chrome manages it’s on tasks and every tab is another task and that way if one crashes they don’t all crash so that’s a good reason
    1 point
  11. I have tried something similar (but not very elaborated) in my ADAT tool (posted in the example scripts section). A tab per GUI, a few lines to create the GUI and a function per GUI to process the entered data.
    1 point
  12. Deye

    Google Speech API

    falcontechnics more info from this topic Finding alternatives to what I was seeking to do ,I didn't get to do anything more then whats described in the thread so keep in mind that you will need to search through Google's help to further advance your goal.. As stated in the second from the last post in the thread Hope this helps
    1 point
  13. 1) why not ? it depends on the wanted subsequent use 2) no 3) not really. see 2nd part of 1) 4) very subjective. It looks a lot like IBM (intense brain masturbation) , but ... see both parts of 1)
    1 point
  14. @LoneWolf_2106 when you say last row I am assuming you mean last used row, correct? If so, there are a couple of ways you can do it. Something like this is you want all of the data in an array, for later manipulation: #include <Array.au3> #include <Excel.au3> Local $oExcel = _Excel_Open() Local $oWorkbook = _Excel_BookOpen($oExcel, @DesktopDir & "\defects.xlsx") Local $aRange = _Excel_RangeRead($oWorkbook, Default, $oExcel.ActiveSheet.UsedRange) _Excel_BookClose($oWorkbook) _Excel_Close($oExcel) $iLastRow = (UBound($aRange)) ConsoleWrite($iLastRow & @CRLF) Or something like this is you purely want to know the row count: #include <Array.au3> #include <Excel.au3> Local $oExcel = _Excel_Open() Local $oWorkbook = _Excel_BookOpen($oExcel, @DesktopDir & "\defects.xlsx") Local $iLastRow = $oExcel.ActiveSheet.UsedRange.Rows.Count _Excel_BookClose($oWorkbook) _Excel_Close($oExcel) ConsoleWrite($iLastRow & @CRLF)
    1 point
  15. Inververs

    API Command (Google)

    @Deye download this udf https://github.com/inververs/googletoken This is example with OAuth 2.0 client ID. But it is better for you to make a service account I have no google drive. Therefore, I can not say what the result will be. Set your own json file and file id #include '_googletoken.au3' $client_json_file = 'client_secret_878378520961-hehpvlick1fkk1f24f1kbhqnl4vep6so.apps.googleusercontent.com.json' _googleapis_setupDesktopOAuth2FromFile($client_json_file) _googleapis_setScope('https://www.googleapis.com/auth/drive') $sAccessToken = _googleapis_getToken() MsgBox(0, 'Token', $sAccessToken) If Not $sAccessToken Then Exit $sFileId = 'enter here fileid' $sURL = 'https://www.googleapis.com/drive/v2/files/' & $sFileId & '/touch' $sHead = 'Authorization=' & 'Bearer ' & $sAccessToken $sResponse = __googleapis_request('POST', $sURL, '', $sHead) MsgBox(0, 'Response', $sResponse)
    1 point
  16. I posted this the other day, but thought I would post in a separate topic instead. #include <MsgBoxConstants.au3> ; ---- Start of Person Class ; Stored in the 'object' to verify it's our 'object' and not some random array Global Const $PERSON_GUID = '4197B285-6AB1-489B-8585-08C852E33F3D' ; Friendly names for 0, 1, 2 and 3 Global Enum $PERSON_AGE, $PERSON_NAME, $PERSON_ID, $PERSON_MAX ; Constructor Func Person($sName, $iAge) Local $hPerson[$PERSON_MAX] ; Set the GUID, so as the verification will work $hPerson[$PERSON_ID] = $PERSON_GUID Person_SetAge($hPerson, $iAge) Person_SetName($hPerson, $sName) ; Return the Person 'object' Return $hPerson EndFunc ;==>Person ; Getter for the age property Func Person_GetAge(ByRef $hPerson) Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_AGE] : Null EndFunc ;==>Person_GetAge ; Setter for the age property Func Person_SetAge(ByRef $hPerson, $iAge) ; If not a valid 'object' or integer then return If Not _Person_IsObject($hPerson) Or Not IsInt($iAge) Then Return ; Set the age $hPerson[$PERSON_AGE] = $iAge EndFunc ;==>Person_SetAge ; Getter for the name property Func Person_GetName(ByRef $hPerson) Return _Person_IsObject($hPerson) ? $hPerson[$PERSON_NAME] : Null EndFunc ;==>Person_GetName ; Setter for the name property Func Person_SetName(ByRef $hPerson, $sName) ; If not a valid 'object' then return If Not _Person_IsObject($hPerson) Then Return ; Set the name $hPerson[$PERSON_NAME] = $sName EndFunc ;==>Person_SetName ; ToString() for the 'object' Func Person_ToString(ByRef $hPerson) Return _Person_IsObject($hPerson) ? StringFormat('Name: %s, Age: %i', $hPerson[$PERSON_NAME], $hPerson[$PERSON_AGE]) : Null EndFunc ;==>Person_ToString ; Check if it's a valid 'object' and not some random array. "NTERNAL ONLY! Func _Person_IsObject(ByRef $hPerson) Return UBound($hPerson) = $PERSON_MAX And $hPerson[$PERSON_ID] == $PERSON_GUID EndFunc ;==>_Person_IsObject ; ---- End of Person Class Example() Func Example() ; Store the Person 'object', which is just a glorified array Local $hP1 = Person('John', 30) ; Display the 'object' MsgBox($MB_SYSTEMMODAL, 'Person 1', Person_ToString($hP1)) ; Create a new person ; Store the Person 'object', which is just a glorified array Local $hP2 = Person('James', 36) ; Display the 'object' MsgBox($MB_SYSTEMMODAL, 'Person 2', Person_ToString($hP2)) ; Set the age for Person 2 Person_SetAge($hP2, 45) ; Display the 'object' MsgBox($MB_SYSTEMMODAL, 'Person 2 - Revised', Person_ToString($hP2)) EndFunc ;==>Example
    1 point
  17. Jefrey

    JSONgen: JSON generator

    Hey folks! I bring this JSON generator I made, which uses a syntax that reminds OOP a little. Here's an example: #include "JSONgen.au3" $oJson = New_Json() ; Let's add some stand-alone elements Json_AddElement($oJson, "test") ; A string Local $aArray[2] = ['hai', 'halo'] Json_AddElement($oJson, $aArray) ; An array ; Let's add some associative elements Json_AddElement($oJson, "hey", 2.55) Json_AddElement($oJson, "delete", "me") ; We will delete this one Json_AddElement($oJson, "hoo", True) Json_AddElement($oJson, "edit", "this") ; And edit this one ; Let's do some editing Json_DeleteElement($oJson, "delete") ; Deleting that one Json_EditElement($oJson, "edit", "that") ; Editing that one ; Let's now add an associated (non-associative) array :) Local $aArray[2] = ['hey', 'bye'] Json_AddElement($oJson, 'array', $aArray) ; Now we get the JSON $sTheJsonCode = Json_GetJson($oJson) MsgBox(0, "Json code", $sTheJsonCode)This will show: Includes help. License: CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/) Download: https://www.autoitscript.com/forum/files/file/345-jsongen-json-generator/
    1 point
  18. Here's the secret sauce behind the hood: Local $sText = "中國 한국어 ไทย" Local $sUTF8 = BinaryToString(StringToBinary($sText, 4), 1) IniWrite("my.ini", "test", "key", $sUTF8) Local $sRaw = IniRead("my.ini", "test", "key", "I'm not there") Local $sValue = BinaryToString(StringToBinary($sRaw, 1), 4) MsgBox(0, "Round-trip check", $sValue)
    1 point
×
×
  • Create New...