Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/04/2017 in all areas

  1. This forum (Au3 Technical) is inhabited by luminaries whose posts frequently demonstrate understanding far beyond my capabilities. For that reason, and at Jon's suggestion, I am reaching out to tap into your wisdom for a project that I have been working on a for a while. I was looking for a way to give back to AutoIt. As a self-taught programmer I have learned an incredible amount from this forum and the help file. It has been very rewarding. Over the course of my personal experiences I have wished, at times, that even though the materials and support are truly incredible - that someone could explain some of the more basic concepts. At the same time, I saw the creation of code.org and I started to think that AutoIt would be a perfect learning tool for people starting out (because of the simplicity, the incredible help file, and the best forum I have ever seen). All of that led to the creation of this text: https://www.autoitscript.com/forum/files/file/351-learn-to-program-using-free-tools-with-autoit/. It is the first draft of a basic introduction to programming using AutoIt. Nobody has reviewed it. Accordingly, I seek the collective constructive feedback of anyone willing to offer opinion as to content, spot any errors, and make any suggestions to improve it. My goal was always to donate it to the AutoIt forum when it was done. I think it could be a good addition to fill the gap for neophytes who may crave to see how everything fits together. The last thought I will leave you with - similar to the first - is that I am not the world's greatest coder (this may be a case of those who can do and those who can't teach). That said, I am hoping that the issues you will undoubtedly spot are not huge or threatening to the overall effort and that you appreciate the fact that this took some time to pull together. I look forward to hearing your thoughts.
    1 point
  2. Edit: A solution was found! Thanks Jos and others who helped me find this: You can have AutoIt run a different "Main" autoit script when you hit F5 instead of the current one, per folder, by doing the following: Run SciTE (might need administrator, depending on how autoit was installed) Options -> global properties (alt o g) Uncomment properties.directory.enable=1 (line 270 in my case) create a file SciTEDirectory.properties in the project's main folder Alternatively, if you don't have admin or don't want to edit the global.properties for whatever reason, you can just skip step 1,2,3 and name it SciTE.properties Put in the file you created command.go.$(au3)="$(SciteDefaultHome)\..\AutoIt3.exe" "$(SciteDefaultHome)\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "NAME OF SCRIPT HERE.au3" /UserParams $(1) $(2) $(3) $(4) Save the file. Now anything you run in that folder or subfolder will run the main script when you hit F5 Using SciTEDirectory.properties effects that folder and subfolders, where as SciTE.properties only effects that folder. Apart from that they work the same Original question: I have a main script, and a bunch of includes / udf's. Almost every single time I edit my includes I hit F5 to run the script, but it runs the include instead. I'm tired of switching back to the main script's tab in SciTE to run it, just to switch back to the include. Is there some kind of #flag or option to set a "main au3 file" so when I hit F5, it will see that and run the main file instead?
    1 point
  3. Help file doesn't seems to have an example for _WinAPI_WaitForSingleObject Below a simple adaptation from the _WinAPI_FindNextChangeNotification help example (also posted in the russian forum) i'm using something similar as a way of data transfer between computers having a shared folder #include <WinAPIEx.au3> Local Const $g_sPath = @ScriptDir Global $hDir = _WinAPI_FindFirstChangeNotification($g_sPath, $FILE_NOTIFY_CHANGE_LAST_WRITE) Local $iID, $bBoolean = False While 1 Sleep(1000) ;Adapted from Help File example for _WinAPI_FindFirstChangeNotification function ;My tests without the second parameter seems to have the issue 'can't exit normally' described here: ;https://www.autoitscript.com/forum/topic/180602-readdirectorychangesw-exit/ $iID = _WinAPI_WaitForSingleObject($hDir, 0) Switch $iID Case 0 ; WAIT_OBJECT_0 If $bBoolean = True Then $bBoolean = False Else $bBoolean = True ConsoleWrite('A file was changed in the directory.' & @CRLF) Beep(400,50) EndIf Case Else ContinueLoop EndSwitch If Not _WinAPI_FindNextChangeNotification($hDir) Then MsgBox(0, 'Error', 'Unexpected error.') Exit EndIf WEnd Func OnAutoItExit() _WinAPI_FindCloseChangeNotification($hDir) ConsoleWrite('Bye-bye!' & @CRLF) EndFunc For those interested in the data transfer application, this is what i'm using: Main.au3 #pragma compile(AutoItExecuteAllowed, True) #include <WinAPIEx.au3> ;test directory: Global Const $g_sPath = "C:\Documents and Settings\XP\Escritorio\InterPC\bridge" Global $hDir = _WinAPI_FindFirstChangeNotification($g_sPath, $FILE_NOTIFY_CHANGE_LAST_WRITE) Global $sFileRead Local $aArray Local $iID, $bBoolean = False While 1 Sleep(1000) $iID = _WinAPI_WaitForSingleObject($hDir, 0) Switch $iID Case 0 ; WAIT_OBJECT_0 If $bBoolean = True Then $bBoolean = False Else $bBoolean = True ;ConsoleWrite('A file was changed in the directory.' & @CRLF) ReadLine() ;_RunAU3(".\scripts\AU3_Example.au3", $sFileRead, "", @SW_SHOW, 8) ;in $sFileRead there is a string with this format: AU3_Example.au3|parameter1 'parameter 2' ""parameter 3"" $aArray = StringSplit($sFileRead, "|") _RunAU3(".\scripts\" & $aArray[1], $aArray[2], "", @SW_SHOW, 8) EndIf Case Else ContinueLoop EndSwitch If Not _WinAPI_FindNextChangeNotification($hDir) Then MsgBox(0, 'Error', 'Unexpected error.') Exit EndIf WEnd Func OnAutoItExit() _WinAPI_FindCloseChangeNotification($hDir) ;ConsoleWrite('Bye-bye!' & @CRLF) EndFunc Func ReadLine() Local Const $sFilePath = $g_sPath & "\line.txt" ;Open the file for reading and store the handle to a variable. Local $hFileOpen = FileOpen($sFilePath, $FO_READ) If $hFileOpen = -1 Then MsgBox(0, "", "An error occurred when reading the file.") Return False EndIf ;Read the fist line of the file using the handle returned by FileOpen. $sFileRead = FileReadLine($hFileOpen, 1) ;Close the handle returned by FileOpen. FileClose($hFileOpen) ;Display the first line of the file. ;MsgBox($MB_SYSTEMMODAL, "", $sFileRead) EndFunc ;https://www.autoitscript.com/forum/topic/135203-call-another-script/?do=findComment&comment=943199 ;guinness Func _RunAU3($sFilePath, $sParamet="", $sWorkingDir = "", $iShowFlag = @SW_SHOW, $iOptFlag = 0) Return Run('"' & @AutoItExe & '" /AutoIt3ExecuteScript "' & $sFilePath & '" "' & $sParamet & '"', $sWorkingDir, $iShowFlag, $iOptFlag) ;Return Run('"' & @AutoItExe & '" /AutoIt3ExecuteScript "' & $sFilePath & '"' & ' "Bos Días"', $sWorkingDir, $iShowFlag, $iOptFlag) EndFunc ;==>_RunAU3 UPDATE: I'm finally using a slightly different version of the 'Main' script. It seems more simple: without the boolean variable: #pragma compile(AutoItExecuteAllowed, True) ;#pragma compile(Icon, local_gray.ico) #include <WinAPIEx.au3> #include <Misc.au3> If _Singleton("test", 1) = 0 Then Msgbox(48,"Warning","already running." & @LF & "This instance will close.", 5) Exit EndIf OnAutoItExitRegister("OnAutoItExit") Global $g_sPath, $sFileRead, $aArray, $iID $g_sPath = "C:\Documents and Settings\XP\Escritorio\InterPC\bridge" Global $hDir = _WinAPI_FindFirstChangeNotification($g_sPath, $FILE_NOTIFY_CHANGE_LAST_WRITE) While 1 Sleep(500) CheckFile() WEnd Func CheckFile() $iID = _WinAPI_WaitForSingleObject($hDir, 0) If $iID = 0 Then ; WAIT_OBJECT_0 ;ConsoleWrite('A file was changed in the directory.' & @CRLF) Local $sFilePath = $g_sPath & "\line.txt" ;Open the file for reading and store the handle to a variable. Local $hFileOpen = FileOpen($sFilePath, $FO_READ) If $hFileOpen = -1 Then MsgBox(0, "", "An error occurred when reading the file.") Return False EndIf ;Read the fist line of the file using the handle returned by FileOpen. $sFileRead = FileReadLine($hFileOpen, 1) ;Close the handle returned by FileOpen. FileClose($hFileOpen) ;_RunAU3(".\scripts\AU3_Example.au3", $sFileRead, @ScriptDir, @SW_SHOW, 8) ;in $sFileRead there is a string with this format: AU3_Example.au3|parameter1 'parameter 2' ""parameter 3"" $aArray = StringSplit($sFileRead, "|") _RunAU3(".\scripts\" & $aArray[1], $aArray[2], @ScriptDir, @SW_SHOW, 8) ;SoundPlay(@WindowsDir & "\media\tada.wav", 0) ; Chimes.wav EndIf If Not _WinAPI_FindNextChangeNotification($hDir) Then MsgBox(48, 'Error', 'Bridge folder not found: revise settings.ini') Exit EndIf EndFunc ;https://www.autoitscript.com/forum/topic/135203-call-another-script/?do=findComment&comment=943199 ;guinness Func _RunAU3($sFilePath, $sParamet="", $sWorkingDir = "", $iShowFlag = @SW_SHOW, $iOptFlag = 0) Return Run('"' & @AutoItExe & '" /AutoIt3ExecuteScript "' & $sFilePath & '" "' & $sParamet & '"', $sWorkingDir, $iShowFlag, $iOptFlag) ;Return Run('"' & @AutoItExe & '" /AutoIt3ExecuteScript "' & $sFilePath & '"' & ' "Bos Días"', $sWorkingDir, $iShowFlag, $iOptFlag) EndFunc ;==>_RunAU3 Func OnAutoItExit() _WinAPI_FindCloseChangeNotification($hDir) EndFunc 'bridge' is the folder being monitored, and 'scripts' is another folder containing the scripts to execute when a change is detected Here an example in the scripts folder: AU3_Example.au3 MsgBox(0, "It Works", "Hello World, " & $CmdLine[1]) ConsoleWrite("Hello World from ConsoleWrite!, " & $CmdLine[1]) This is an example of an UPDATE statement with a MS ACCESS database in the server computer using the ADODB command method ;Help: COM Error Handling Global $errADODB = ObjEvent("AutoIt.Error","_ErrADODB") If $CmdLine[0] = 0 Then Exit ;there is no parameter passed to the executable Local $sFilename = "_____" Global Const $iCursorType = 0 ; adOpenForwardOnly Global Const $iLockType = 1 ;1 adLockReadOnly, 3 adLockOptimistic Global Const $iOptions = 1 ; Options, 1 Evaluates as a textual definition of a command or stored procedure call ; 2 adCmdTable Global $cn = ObjCreate("ADODB.Connection") ; Create a connection object ;Global $sADOConnectionString = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & $sFilename Global $sADOConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & $sFilename & ";Jet OLEDB:Database Password=___;" $cn.Open($sADOConnectionString) ; Open the connection Global $cmd = ObjCreate("ADODB.Command") $cmd.ActiveConnection = $cn Global $sSQL = $CmdLine[1] $cmd.CommandText = $sSQL $cmd.CommandType = 1 ;adCmdText ;https://www.w3schools.com/asp/ado_ref_command.asp ;https://www.autoitscript.com/forum/topic/80351-adodb-command-method/ $cmd.Execute(Default,Default, 0x80) $cmd = 0 $cn.Close ; Close the connection $cn = 0 ; Release the connection object Func _ErrADODB() Msgbox(0,"ADODB COM Error","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $errADODB.description & @CRLF & _ "err.windescription:" & @TAB & $errADODB.windescription & @CRLF & _ "err.number is: " & @TAB & hex($errADODB.number,8) & @CRLF & _ "err.lastdllerror is: " & @TAB & $errADODB.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $errADODB.scriptline & @CRLF & _ "err.source is: " & @TAB & $errADODB.source & @CRLF & _ "err.helpfile is: " & @TAB & $errADODB.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $errADODB.helpcontext _ ) Local $err = $errADODB.number If $err = 0 Then $err = -1 EndFunc An example of a SELECT query, saving the recordset as xml in a shared folder ;Help: COM Error Handling Global $errADODB = ObjEvent("AutoIt.Error","_ErrADODB") If $CmdLine[0] = 0 Then Exit ;there is no parameter passed to the executable Local $sFilename = "_somepath_\MyDataBase.mdb" Local $sFilename2 = "_somepath_\InterPC\out\example.xml" FileDelete($sFilename2) Global Const $iCursorType = 0 ; adOpenForwardOnly Global Const $iLockType = 1 ;1 adLockReadOnly, 3 adLockOptimistic Global Const $iOptions = 1 ; Options, 1 Evaluates as a textual definition of a command or stored procedure call ; 2 adCmdTable Global $cn = ObjCreate("ADODB.Connection") ; Create a connection object Global $rst = ObjCreate("ADODB.Recordset") ; Create a recordset object ;Global $sADOConnectionString = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & $sFilename Global $sADOConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & $sFilename & ";Jet OLEDB:Database Password=__;Mode=Read" $cn.Open($sADOConnectionString) ; Open the connection Local $sSQL = "SELECT ____" _ & " FROM __" _ & " WHERE " & $CmdLine[1] _ & " ORDER BY __;" $rst.Open($sSQL, $cn, $iCursorType, $iLockType, $iOptions) ; Issue the SQL query $rst.Save($sFilename2, 1) $rst.Close $rst = 0 ; Release the recordset object $cn.Close ; Close the connection $cn = 0 ; Release the connection object Func _ErrADODB() Msgbox(0,"ADODB COM Error","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $errADODB.description & @CRLF & _ "err.windescription:" & @TAB & $errADODB.windescription & @CRLF & _ "err.number is: " & @TAB & hex($errADODB.number,8) & @CRLF & _ "err.lastdllerror is: " & @TAB & $errADODB.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $errADODB.scriptline & @CRLF & _ "err.source is: " & @TAB & $errADODB.source & @CRLF & _ "err.helpfile is: " & @TAB & $errADODB.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $errADODB.helpcontext _ ) Local $err = $errADODB.number If $err = 0 Then $err = -1 EndFunc Finally an example of an INSERT query: ;Help: COM Error Handling Global $errADODB = ObjEvent("AutoIt.Error","_ErrADODB") If $CmdLine[0] = 0 Then Exit ;there is no parameter passed to the executable Local $aArray $aArray = StringSplit($CmdLine[1], Chr(1)) Local $sSQL, $IdCab, $sYear $sYear = @YEAR Global Const $iCursorType = 0 ; adOpenForwardOnly, 3 adOpenStatic Global Const $iLockType = 3 ;1 adLockReadOnly, 3 adLockOptimistic Global Const $iOptions = 1 ; Options, 1 Evaluates as a textual definition of a command or stored procedure call ; 2 adCmdTable Global $cn = ObjCreate("ADODB.Connection") ; Create a connection object Global $rst = ObjCreate("ADODB.Recordset") ; Create a recordset object ;Global $sADOConnectionString = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & $sFilename ;Global $sADOConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & $sFilename & ";Jet OLEDB:Database Password=__" $cn.CursorLocation = 3 ; adUseClient $cn.Open($aArray[1]) ; Open the connection ;this ok ;$sSQL = "CREATE TABLE AutoIncrementTest " _ ; & "(ID int identity, Description varchar(40), " _ ; & "CONSTRAINT AutoIncrementTest_PrimaryKey PRIMARY KEY (ID))" ;$cn.Execute($sSQL, Default, 1 + 0x80) ;adCmdText = 1 , adExecuteNoRecords = 0x80 ;this ok ;Global $cmd = ObjCreate("ADODB.Command") ;$cmd.ActiveConnection = $cn ;$cmd.CommandText = $sSQL ;$cmd.CommandType = 1 ;adCmdText ;https://www.w3schools.com/asp/ado_ref_command.asp ;https://www.autoitscript.com/forum/topic/80351-adodb-command-method/ ;$cmd.Execute(Default,Default, 1 + 0x80) $sSQL = "SELECT MAX(Val(SOMEFIELD)) FROM SOMETABLE" $rst.Open($sSQL, $cn, $iCursorType, $iLockType, $iOptions) ; Issue the SQL query Local $CodAlb = StringFormat("%06i", $rst(0).Value + 1) ;MsgBox(0,"","New code Nº: " & $CodAlb) $rst.Close ;$sSQL = "SELECT ID, Description FROM AutoIncrementTest" $sSQL = "SELECT ID, YEAR, FIELD2, FIELD3, ____________ FROM MYTABLE" $rst.Open($sSQL, $cn, $iCursorType, $iLockType, $iOptions) ; Issue the SQL query $cn.BeginTrans $rst.AddNew ;$rst("Description").Value = "AutoIncrement Test" ;$rst.Fields("Description") = "AutoIncrement Test" $rst("YEAR").Value = $sYear $rst("CODIGO").Value = $CodAlb $rst("FIELD2").Value = $aArray[2] $rst("FIELD3").Value = $aArray[5] ;... $rst.Update $IdCab = $rst(0).Value ;MsgBox(0,"","New Auto-increment value is: " & $IdCab) $rst.Close $sSQL = "UPDATE OTHERTABLE SET SOMEFIELD = " & $aArray[15] & " WHERE LINEASPEDIDO.ID = " & $aArray[14] $cn.Execute($sSQL, Default, 1 + 0x80) ;adCmdText = 1 , adExecuteNoRecords = 0x80 $cn.CommitTrans ;$cmd = 0 $rst = 0 ; Release the recordset object $cn.Close ; Close the connection $cn = 0 ; Release the connection object Func _ErrADODB() Msgbox(0,"ADODB COM Error","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $errADODB.description & @CRLF & _ "err.windescription:" & @TAB & $errADODB.windescription & @CRLF & _ "err.number is: " & @TAB & hex($errADODB.number,8) & @CRLF & _ "err.lastdllerror is: " & @TAB & $errADODB.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $errADODB.scriptline & @CRLF & _ "err.source is: " & @TAB & $errADODB.source & @CRLF & _ "err.helpfile is: " & @TAB & $errADODB.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $errADODB.helpcontext _ ) Local $err = $errADODB.number If $err = 0 Then $err = -1 EndFunc
    1 point
  4. This works in a different way, beacause it´s a scintilla control. But you can add it in your macro. Include a new action with "execute command" and choose one of the following: (without the comments of course :P) SetStyle($Debug_log, $STYLE_DEFAULT, _RGB_to_BGR(0xFF0000), _RGB_to_BGR($scripteditor_bgcolour), $scripteditor_size,$scripteditor_font) ;Replace the default font color for the editor SetStyle($Debug_log, 4, _RGB_to_BGR(0x0000FF), _RGB_to_BGR($scripteditor_bgcolour), 0, "", 0) ;Replace the blue text SetStyle($Debug_log, 10, _RGB_to_BGR(0xFF0000), _RGB_to_BGR($scripteditor_bgcolour), 0, "", 1) ;Replace the red text SetStyle($Debug_log, 11, _RGB_to_BGR(0x007F00), _RGB_to_BGR($scripteditor_bgcolour), 0, "", 1);;Replace the green text Should do the job
    1 point
  5. Local $iOStr = StringRegExp($iContent, '/<meta(?=[^>]*name="description")\s[^>]*content=''([^>]*)"/sig', 1,1)
    1 point
  6. #include <File.au3> ; only used for the example script, not needed for the UDF #include <Array.au3> ; only used for the example script, not needed for the UDF #include <Constants.au3> ; only used for the MsgBox, not needed for the UDF example() Func example() Local $n, $t, $aDetails For $n = 1 To 10 $t = TimerInit() $aDetails = _FileGetProperty(@ScriptFullPath, 11) ConsoleWrite(Round(TimerDiff($t), 3) & @TAB & $aDetails & @CRLF) Next ConsoleWrite(@CRLF) For $n = 1 To 10 ; shows the optimization, repeatedly getting a property by name $t = TimerInit() $aDetails = _FileGetProperty(@ScriptFullPath, "Owner") ConsoleWrite(Round(TimerDiff($t), 3) & @TAB & $aDetails & @CRLF) Next ConsoleWrite(@CRLF) $t = TimerInit() $aDetails = _FileGetProperty(StringLeft(@WindowsDir, 2)) ; Returns an array with all properties of the file ConsoleWrite(Round(TimerDiff($t), 3) & ' - Drive properties' & @CRLF) _ArrayDisplay($aDetails, "Drive properties") $t = TimerInit() $aDetails = _FileGetProperty(@ScriptFullPath) ; Returns an array with all properties of the file ConsoleWrite(Round(TimerDiff($t), 3) & ' - file properties' & @CRLF) _ArrayDisplay($aDetails, "file properties") $t = TimerInit() $aDetails = _FileGetProperty(@ScriptDir) ; Returns an array with all properties of the file ConsoleWrite(Round(TimerDiff($t), 3) & ' - folder properties' & @CRLF) _ArrayDisplay($aDetails, "folder properties") $t = TimerInit() $sDetails = _FileGetProperty(@ScriptFullPath, "date modified") ConsoleWrite(Round(TimerDiff($t), 3) & " - date modified" & @CRLF) MsgBox($MB_SYSTEMMODAL, "Date Modified", $sDetails) Exit 0 ; EndFunc ;==>example ;=============================================================================== ; Function Name.....: _FileGetProperty ; Description.......: Returns a property, or all properties, for a file. ; Version...........: 1.0.4 ; Change Date.......: 09-03-2017 ; AutoIt Version....: 3.3.14.x (due to the use of Static, but it could be a Global and use 3.2.12.x) ; Parameter(s)......: $FGP_Path - String containing the file path to return the property from. ; $FGP_PROPERTY - [optional] String containing the name of the property to return. (default = "") ; $iPropertyCount - [optional] The number of properties to search through for $FGP_PROPERTY, or the number of items ; returned in the array if $FGP_PROPERTY is blank. (default = 500) ; Requirements(s)...: None ; Return Value(s)...: Success: Returns a string containing the property value. ; If $FGP_PROPERTY is blank, a two-dimensional array is returned: ; $av_array[0][0] = Number of properties. ; $av_array[1][0] = 1st property name. ; $as_array[1][1] = 1st property value. ; $av_array[n][0] = nth property name. ; $as_array[n][1] = nth property value. ; Failure: Returns an empty string and sets @error to: ; 1 = The folder $FGP_Path does not exist. ; 2 = The property $FGP_PROPERTY does not exist or the array could not be created. ; 3 = Unable to create the "Shell.Application" object $objShell. ; Author(s).........: - Simucal <Simucal@gmail.com> ; - Modified by: Sean Hart <autoit@hartmail.ca> ; - Modified by: teh_hahn <sPiTsHiT@gmx.de> ; - Modified by: BrewManNH ; - Modified by: argumentum ; added some optimization, fixed Win10 issue ; URL...............: https://www.autoitscript.com/forum/topic/148232-_filegetproperty-retrieves-the-properties-of-a-file/?do=findComment&comment=1364968 ; Note(s)...........: Modified the script that teh_hahn posted at the above link to include the properties that ; Vista and Win 7 include that Windows XP doesn't. Also removed the ReDims for the $av_ret array and ; replaced it with a single ReDim after it has found all the properties, this should speed things up. ; I further updated the code so there's a single point of return except for any errors encountered. ; $iPropertyCount is now a function parameter instead of being hardcoded in the function itself. ; Added the use of $FGP_PROPERTY as Index + 1 ( as is shown the array ), in additon to $FGP_PROPERTY as Verb ; Added the array Index to the @extended, as this the optimization is for just te last index used. ; Fixed array chop short on ReDim ( Win10 issue ) ;=============================================================================== Func _FileGetProperty($FGP_Path, $FGP_PROPERTY = "", $iPropertyCount = 500) If $FGP_PROPERTY = Default Then $FGP_PROPERTY = "" $FGP_Path = StringRegExpReplace($FGP_Path, '["'']', "") ; strip the quotes, if any from the incoming string If Not FileExists($FGP_Path) Then Return SetError(1, 0, "") ; path not found Local Const $objShell = ObjCreate("Shell.Application") If @error Then Return SetError(3, 0, "") Local Const $FGP_File = StringTrimLeft($FGP_Path, StringInStr($FGP_Path, "\", 0, -1)) Local Const $FGP_Dir = StringTrimRight($FGP_Path, StringLen($FGP_File) + 1) Local Const $objFolder = $objShell.NameSpace($FGP_Dir) Local Const $objFolderItem = $objFolder.Parsename($FGP_File) Local $Return = "", $iError = 0, $iExtended = 0 Local Static $FGP_PROPERTY_Text = "", $FGP_PROPERTY_Index = 0 If $FGP_PROPERTY_Text = $FGP_PROPERTY And $FGP_PROPERTY_Index Then If $objFolder.GetDetailsOf($objFolder.Items, $FGP_PROPERTY_Index) = $FGP_PROPERTY Then Return SetError(0, $FGP_PROPERTY_Index, $objFolder.GetDetailsOf($objFolderItem, $FGP_PROPERTY_Index)) EndIf EndIf If Int($FGP_PROPERTY) Then $Return = $objFolder.GetDetailsOf($objFolderItem, $FGP_PROPERTY - 1) If $Return = "" Then $iError = 2 EndIf ElseIf $FGP_PROPERTY Then For $I = 0 To $iPropertyCount If $objFolder.GetDetailsOf($objFolder.Items, $I) = $FGP_PROPERTY Then $FGP_PROPERTY_Text = $FGP_PROPERTY $FGP_PROPERTY_Index = $I $iExtended = $I $Return = $objFolder.GetDetailsOf($objFolderItem, $I) EndIf Next If $Return = "" Then $iError = 2 EndIf Else Local $av_ret[$iPropertyCount + 1][2] For $I = 1 To $iPropertyCount If $objFolder.GetDetailsOf($objFolder.Items, $I) Then $av_ret[0][0] = $I $av_ret[$I][0] = $objFolder.GetDetailsOf($objFolder.Items, $I - 1) $av_ret[$I][1] = $objFolder.GetDetailsOf($objFolderItem, $I - 1) EndIf Next ReDim $av_ret[$av_ret[0][0] + 1][2] If Not $av_ret[1][0] Then $iError = 2 $av_ret = $Return Else $Return = $av_ret EndIf EndIf Return SetError($iError, $iExtended, $Return) EndFunc ;==>_FileGetProperty @careca, it's ok now.
    1 point
  7. I know I disappointed some of you guys with this version as you were waiting for the requested features like Sliders, InputBox, Support for tabbing through controls and other stuff. I spent a lot of time for other improvements and got tired of trying to find ways to get stuff to work I tried adding many other things like fully transparent controls, but ended up building in so many workarounds and it still didn't fully work as I wanted to.. I know there are examples for sliders etc. but it gets too complicated and too time consuming when trying to build it into the UDF for easy usage. These are the things on my ToDo List at the moment but I can't tell if or when I will built them in. Windows 10 Style Sliders (Like the volume slider) Some sort of modern looking tab/menu. Simple Inputbox (low prio) Support for tabbing through controls Maybe someone is interested in helping out
    1 point
  8. Moved to the appropriate forum, as the DEV forum clearly states:
    1 point
  9. Version 3.2.0.3

    1,404 downloads

    ADCU displays two Active Directory users and their group membership in two listviews. You can filter and export the data to Excel, Outlook mail and the clipboard. Before running the script you need to change file AD-Tools.ini and function _Check_Access in AD-Tools_User.au3. BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort Needs to be run with the latest AutoIt production version (>= 3.3.12.0). Needs to be run with the latest version of the AD UDF (>= 1.4.2.0).
    1 point
×
×
  • Create New...