Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/23/2021 in all areas

  1. Ok ... next "try": New Beta is available which is a revert of the previous version and this time simply uses the original filename in the RUN function.
    1 point
  2. I see another problem if you create the temp file in the original script folder. What if there is a non-standard ascii character in the path before the file? So for example "C:\Users\Jörg\Desktop\AutoIt3Wrapper tests\test file.au3" The same is true if you use the user temp folder: "C:\Users\Jörg\AppData\Local\Temp\AutoIt3WrapperRunTmpFiles\test file.au3" Or does the problem exist only when there is a non-standard ascii character in the filename, not in the path?
    1 point
  3. If you only want to create easy customised standalone installs, recommend NTLite https://www.ntlite.com/ comes in a free, home, pro and business editions, extremely easy to use, have used it previously for a couple of small businesses with 10 or less workstations.
    1 point
  4. For the fun #Include <Array.au3> $txt = "ProgramA.exe" & @crlf & _ " Directory: C:\Program Files\Maker\ProgramAFolder" & @crlf & _ " Product Version: 1.0.455.0" & @crlf & _ " File Version: 1.0.455.0" & @crlf & _ " Creation Date: 05/15/2019 19:02:00" & @crlf & _ " " & @crlf & _ "ProgramB.exe" & @crlf & _ " Directory: C:\Program Files\Maker\ProgramBFolder" & @crlf & _ " Product Version: 1.0.456.0" & @crlf & _ " File Version: 1.0.456.0" & @crlf & _ " Creation Date: 05/15/2019 19:04:00" $r = Execute("'" & StringRegExpReplace($txt, "(?ms)^(\w+).*?Product Version: (\S+)\R(\h\N+\R?)+", "' & '$1|$2' & '") & "'") Local $a[0][2] _ArrayAdd($a, $r) _ArrayDisplay($a)
    1 point
  5. I'm often supplied spreadsheets from other departments that contain data to drive my scripts. The problem that I often have is they like to apply cell formatting (Especially for Dates) which make it easy for them to use, but makes it crazy slow to open in my automation as I need to use the _Excel_RangeRead() with the Return option 3 and read one cell at a time. For some reason, today I realized I could cheat a bit and made it so much easier and quicker. I just opened the spreadsheet, then saved as a Tab delimited text file, then performed a _FileReadToArray() to get the actual displayed values. works so much faster than reading cell by cell. #include <File.au3> #include <Excel.au3> #include <Array.au3> Local $aRecords ;Will contain the data from the converted file $hFileLoc = FileOpenDialog("Spreadsheet Data", @ScriptDir, "Excel (*.xls;*.xlsx)") ;To select an Excel file If @error Then Exit $sDataFile = _TempFile(@TempDir, "~", ".txt") ;Create a temp file that will store the spreadsheet data ConsoleWrite("CSV file = (" & $sDataFile & ")" & @CRLF) ;So I can view it manually while testing ;*** Spreadsheet formatted as Numbers, Currency, Dates, etc. $oExcel = _Excel_Open(False, False, False, False, True) ;Open Excel a NEW excel app in Hidden mode $oWorkbook = _Excel_BookOpen($oExcel, $hFileLoc, True, False) ;Have Excel open the selected spreadsheet as Read Only _Excel_BookSaveAs($oWorkbook, $sDataFile, $xlTextWindows, True) ;Save as a Tab delimited text file; $xlCSVMSDOS for .csv if @error Then MsgBox(0, "Error", "Failed to Open the Excel file for reading") Exit EndIf _Excel_BookClose($oWorkbook, False) ;Close the selected spreadsheet _Excel_Close($oExcel, False) ;Close Excel If IsObj($oExcel) Then $oExcel.Quit ;Ensure the Excel actually closed _FileReadToArray($sDataFile, $aRecords, 0, @TAB) ;Read the newly created Tab delimited file into an array If @error Then MsgBox(0, "Error", "Failed to read the Excel data") Exit EndIf FileDelete($sDataFile) ;Remove the temp file since its in memory now ;This often brings over extra rows and columns so clean it up with this loop For $r = 0 to UBound($aRecords) - 1 If $aRecords[$r][0] = "" Then ;If A is empty on this row then assume we have reached the end of data ReDim $aRecords[$r][10] ;Remove extra rows, and in this case remove any columns after J ExitLoop EndIf Next _ArrayDisplay($aRecords, "Read Values")
    1 point
  6. mikell

    for loop to inputboxes

    Try Eval("Input" & $i) ... but it would be much cleaner to make an array to store the inputs ids - this also allows the creation of the 11 inputs in the For loop Local $aInputs[11] For $i = 0 to 10 $aInputs[$i] = GUICtrlCreateInput("", 31, ($i*32)+24, 489, 21) GUICtrlSendMsg($aInputs[$i], $EM_SETCUEBANNER, True, "F1") Next
    1 point
  7. Finally I was able to solve this! I'm really excited! So here's what I found: according to Microsoft's System Wake-up Events, "When the system wakes automatically, the display is not automatically turned on." I was able to figure out how to get the screen on after a resume. The function below will do it. #cs ********************************************************************************************************* Function Name: _Monitor_ON Author: apstanto Description: Turns the monitor on after a System Wake-up Event and broadcast of PBT_APMRESUMEAUTOMATIC Input: None Return: Success: @error = 0. Failure: set @error @error: 1 unable to use the DLL file, 2 unknown "return type", 3 "function" not found in the DLL file, 4 bad number of parameters. #ce ********************************************************************************************************* Func _Monitor_ON() $ES_DISPLAY_REQUIRED = 2 DllCall("Kernel32.dll", "long", "SetThreadExecutionState", "long", $ES_DISPLAY_REQUIRED) EndFunc I hope this works for you too!
    1 point
×
×
  • Create New...