Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/14/2018 in all areas

  1. _ArrayDisplayCtrl See "Embedded controls" section in top of first post for general information about embedded GUI controls. This is copied from the bottom of ArrayDisplayEx.au3: ; Displays a 1D or 2D array in a virtual ListView as an embedded GUI control Func _ArrayDisplayCtrl( $hUserGui, $x, $y, $w, $h, _ $aArray, _ ; 1D/2D array eg. StringSplit("Mo,Tu,We,Th,Fr,Sa,Su", ",") $sTitle = "", _ ; GUI title bar text, default title is set to "ArrayDisplayEx" ; <<<< Not used >>>> $sHeader = "", _ ; ListView header column names, default is "Col0|Col1|Col2|...|ColN" $iFlags = 0x0000, _ ; Set additional options through flag values $aFeatures = "" ) ; 2D array of feature type/info pairs ; $iFlags values ; Add required values together ; 0x0000 => Left aligned text ; 0x0002 => Right aligned text ; 0x0004 => Centered text ; 0x0008 => Verbose mode ; 0x0010 => Half-height ListView ; <<<< Not used >>>> ; 0x0020 => No grid lines in ListView ; 0x0040 => No bottom controls ; $aFeatures parameter ; Features available in _ArrayDisplayCtrl: ; ; Features implemented through Common\ files (always usable): ; "ColAlign" => Column alignment ; "ColWidthMin" => Min. column width ; "ColWidthMax" => Max. column width ; "BackColor" => Listview background color ; "HdrColors" => Listview header background colors ; "UserFunc" => User supplied function ; ; Features implemented through include files ; End user features: ; Include file: ; "ColFormats" => Column text formats ; <Display function>_ColumnFormats.au3 ; "ColColors" => Column background colors ; <Display function>_ColumnColors.au3 ; "SortRows" => Sort rows in data source by index ; <Display function>_SortFuncs.au3 ; "SortCols" => Sort columns in data source by index ; <Display function>_SortFuncs.au3 ; "SortByCols" => Sort rows by multiple columns ; <Display function>_SortFuncs.au3 ; ; Debugging features: ; Include file: ; "DataTypes" => Data types info ; <Display function>_DataTypesInfo.au3 ; ; See DisplayFeatures.txt for docu of features ; Error codes in @error ; 1 => No array variable passed to function ; 2 => Larger than 2D array passed to function ; 3 => Missing include file ; 4 => Unsupported feature ; 5 => ControlId error ; 6 => Too many GUIs Note the new flag 0x0040 to remove the bottom controls in the embedded control. Usage of the embedded control is demonstrated in Examples\ArrayDisplayCtrl\. Updated zip-file in bottom of first post.
    2 points
  2. Hello, you can use multiple whileloops
    1 point
  3. You could also do it this way. Run(@Comspec & " /k del <your pathname here>\*.lnk"
    1 point
  4. TheSaint

    TeraCopy Timer

    Heads up. Funny how things belatedly occur to you sometimes. I should add a combining 'ADD TO LIST' option. In fact, I could have easily had the option all along, where a copy or move list is built similar to the new multiple drag & drop combine list. But instead of selecting a bunch of files &/or folders and then drag & dropping them into a combined list for TeraCopy, You could also build that same kind of combined list one by one using drag & drop. No idea why I haven't thought of that until the last 24 hours. Expect to see it added to the next update.
    1 point
  5. Add Book & All Formats To Calibre updated, to v2.4, see Post #4. (v2.4) The current position of the FIND AUTHOR window can now be saved precisely, from a button on the SETUP window. Author Information dialog now has an option to View the Log file. TOP
    1 point
  6. Just focus on: You could use it like this Local $oIESearchButton = _IEGetObjById($oIEopen,'search-btn') _IEAction($oIESearchButton,'click')
    1 point
  7. Just scanning your script, it looks like your file filter is bad. It should probably be "*.lnk" not ".lnk". If you added error checking, specifically checking the value of @error after the _FileListToArray(), my guess is that @error is not 0. Below is an example of one way to do it. The error is telling you that $b is not an array, most likely because the _FileListToArray() failed. #Include <File.au3> #include <Constants.au3> example() Func example() Local $iCount = 0 Local $sDir = @ScriptDir Local $aResult = _FileListToArray($sDir, "*.lnk", $FLTA_FILES, True) If @error Then MsgBox($MB_ICONERROR, "Error", "@error = " & @error) Exit -1 EndIf For $i = 1 To $aResult[0] $iCount += 1 Next MsgBox($MB_ICONINFORMATION, "Result", "Count = " & $iCount) EndFunc
    1 point
  8. AdamUL

    Set Acl permissions UDF

    It looks like you forgot _InitiatePermissionResources and _ClosePermissionResources function calls at the beginning and ending of your script. Give this a try. #Include <Permissions.au3> _InitiatePermissionResources() $ret_Val = _DenyAllAccess(@ScriptDir & "\#Apink's Eunji Tuto! DAILY BEST Video YouTube.mp4") If $ret_Val = 1 Then MsgBox(0, "Permission", "Successful.") EndIf If $ret_Val = 0 Then MsgBox(16, "Permission", "Failure.") EndIf _ClosePermissionResources() Adam
    1 point
  9. When I have to work with combining a lot of CSV files and searching for data, I use SQLite. Its fast, and allows searching with SQL. Here's an example that should help you. #include <Array.au3> #include <File.au3> #include <SQLite.au3> Global $sOutFile = "test.csv" Global $sDir = @ScriptDir & "\Test" Global $aFileList = _FileListToArrayRec($sDir, "*.csv", $FLTAR_FILES, $FLTAR_RECUR) If @error Then Exit 1 ;~ _ArrayDisplay($aFileList) ;For testing. ;Use sqlite3.exe to import files. ;Make sure sqlite3.exe is in the @ScriptDir. ;Use CSV mode for importing and exporting data. Global $sSQLiteExeInput = ".mode csv" & @CRLF ;Table name must not contain spaces, use underscores. Global $sTableName = "Data" $sTableName = StringReplace($sTableName, " ", "_") $sSQLiteExeInput &= "CREATE TABLE " & $sTableName & "(Year,Month,Day,Time,Data);" & @CRLF ;Import files into SQLite table. For $i = 1 To $aFileList[0] $sSQLiteExeInput &= ".import '" & $sDir & "\" & $aFileList[$i] & "' " & $sTableName & @CRLF Next ;Remove NULL rows, if any from import. $sSQLiteExeInput &= 'DELETE FROM "' & $sTableName & '" WHERE "Data" IS NULL;' & @CRLF ;Add DateTime Column, and data to the column to allow for easier searching. $sSQLiteExeInput &= 'ALTER TABLE "' & $sTableName & '" ADD COLUMN "DateTime";' & @CRLF $sSQLiteExeInput &= 'UPDATE "' & $sTableName & '" SET "DateTime" = "Year" || ''-'' || "Month" || ''-'' || "Day" || '' '' || "Time";' & @CRLF $sSQLiteExeInput &= 'CREATE INDEX idxTS ON "' & $sTableName & '"(DateTime);' & @CRLF ;Quit SQLite3.exe $sSQLiteExeInput &= ".quit" & @CRLF Global $sOutFileDB = StringTrimRight($sOutFile, 3) & "db" Global $sSQLiteExeOutput ConsoleWrite($sSQLiteExeInput & @CRLF) ;For testing. ;Execute sqlite3.exe commands. _SQLite_SQLiteExe($sOutFileDB, $sSQLiteExeInput, $sSQLiteExeOutput) If @error Then If @error = 2 Then ConsoleWrite("ERROR: Sqlite3.exe file not found" & @CRLF) Else ConsoleWrite("ERROR: @error=" & @error & " when calling _SQLite_SQLiteExe" & @CRLF) EndIf Exit 1 EndIf ;Get data requested. ;Make sure sqlite3 DLL is in the @ScriptDir. Global $iRows, $iColumns, $aOutFile ConsoleWrite(_SQLite_Startup() & @CRLF) ConsoleWrite("_SQLite_LibVersion=" & _SQLite_LibVersion() & @CRLF) _SQLite_Open($sOutFileDB) Global $sSearchDateTime = "2018-2-1 1:00" ;Sum data values for date. Global $sSQLQuery = 'SELECT Year,Month,Day,Time,sum(Data) FROM "' & $sTableName & '" WHERE "DateTime" = ''' & $sSearchDateTime & '''' ConsoleWrite($sSQLQuery & @CRLF) ;For testing. _SQLite_GetTable2d(-1, $sSQLQuery, $aOutFile, $iRows, $iColumns) ConsoleWrite(@error & @CRLF) _ArrayDisplay($aOutFile, "Sum Data") ;For testing. MsgBox($MB_OK, "Sum Data", "Date: " & $aOutFile[1][1] & "-" & $aOutFile[1][2] & "-" & $aOutFile[1][0] & " " & $aOutFile[1][3] & @CRLF & "Value: " & $aOutFile[1][4]) ;Get max value for date. $sSQLQuery = 'SELECT Year,Month,Day,Time,max(Data) FROM "' & $sTableName & '" WHERE "DateTime" = ''' & $sSearchDateTime & '''' ConsoleWrite($sSQLQuery & @CRLF) ;For testing. _SQLite_GetTable2d(-1, $sSQLQuery, $aOutFile, $iRows, $iColumns) ConsoleWrite(@error & @CRLF) _ArrayDisplay($aOutFile, "Max Data for Date") ;For testing. MsgBox($MB_OK, "Max Data for Date", "Date: " & $aOutFile[1][1] & "-" & $aOutFile[1][2] & "-" & $aOutFile[1][0] & " " & $aOutFile[1][3] & @CRLF & "Value: " & $aOutFile[1][4]) ;Get max value for table. $sSQLQuery = 'SELECT Year,Month,Day,Time,max(Data) FROM "' & $sTableName & '"' ConsoleWrite($sSQLQuery & @CRLF) ;For testing. _SQLite_GetTable2d(-1, $sSQLQuery, $aOutFile, $iRows, $iColumns) ConsoleWrite(@error & @CRLF) _ArrayDisplay($aOutFile, "Max Data for Table") ;For testing. MsgBox($MB_OK, "Max Data for Table", "Date: " & $aOutFile[1][1] & "-" & $aOutFile[1][2] & "-" & $aOutFile[1][0] & " " & $aOutFile[1][3] & @CRLF & "Value: " & $aOutFile[1][4]) _SQLite_Close() _SQLite_Shutdown() ;Delete DB file. FileDelete($sOutFileDB) Adam
    1 point
  10. Documentation for SafeArrayDisplay added to post 5 above. Code for SafeArrayDisplay added to zip-file in bottom of first post. Thanks for all the feedback. Always nice with some feedback.
    1 point
  11. Documentation for _SQLite_Display added to post 4 above. Code for _SQLite_Display added to zip-file in bottom of first post.
    1 point
  12. Jon

    AutoIt v3.3.14.5 Released

    AutoIt v3.3.14.5 has been released. Just a small bug fix to the updater script. Download it here. Complete list of changes: History
    1 point
  13. Well, as far as the laptop being returned, it can't be helped. But Windows 10 being installed on the device is not an issue. If the device originally had Windows 8 or greater installed on it, then its product key is embedded in the BIOS, and a valid Windows 7 or 8 product key will also activate Windows 10 (free upgrade period). What this script does (I had to use it to activate Windows 10 for a deployment project that I was working on for a client and works like a charm) is query the embedded product key from the BIOS using Wmi, then it will take the product key, install it, then activate Windows with it. You may not remember, but during the Windows 10 installation, you were not given an option to select which version of Windows 10 you wanted to install (Home or Pro), right? That was because the installer looked at the product key embedded in the bios, and installed the version of Windows 10 that matched the version of Windows 8 associated with the embedded key.
    1 point
×
×
  • Create New...