Jump to content

Recommended Posts

Posted
Exit _DebugArrayDisplay(_FileListToArray_EverythingSearch(), "Error: " & @error & "  -  File count: " & @extended)
Func _FileListToArray_EverythingSearch($iMaxCount = 5000)
    Local Static $sTitle = "[CLASS:EVERYTHING;]"
    If Not WinExists($sTitle) Then $sTitle = "[CLASS:EVERYTHING;]" ; @ https://www.voidtools.com/
    If Not WinExists($sTitle) Then $sTitle = "[CLASS:EVERYTHING_(1.5a);]" ; @ https://www.voidtools.com/everything-1.5a/  ; this "alpha" has dark mode.
    If Not WinExists($sTitle) Then
        Local $aArray[1] = [0]
        Return SetError(1, 0, $aArray) ; the GUI is not found
    EndIf
    If Not @AutoItX64 Then ; because I use the x64 version of voidtools' "everything" search engine.
        Local $aArray[1] = [0] ; https://www.voidtools.com/
        Return SetError(2, 0, $aArray) ;  ControlListView() must match (64bit or 32bit) as otherwise "death of the apps !"
    EndIf
    Local $iItemCount = ControlListView($sTitle, "", "[CLASS:SysListView32; INSTANCE:1]", "GetItemCount")
    Local $iSubItemCount = ControlListView($sTitle, "", "[CLASS:SysListView32; INSTANCE:1]", "GetSubItemCount")
    If $iItemCount > $iMaxCount Then $iItemCount = $iMaxCount ; $iSubItemCount is not used here but, I copied this from another script.
    Local $aArray[$iItemCount + 1]
    Local $u1 = $iItemCount - 1, $u2 = $iSubItemCount - 1
    For $n = 0 To $u1
        $aArray[$n + 1] = ControlListView($sTitle, "", "[CLASS:SysListView32; INSTANCE:1]", "GetText", $n, 1) & _
                "\" & ControlListView($sTitle, "", "[CLASS:SysListView32; INSTANCE:1]", "GetText", $n, 0)
    Next
    $aArray[0] = $iItemCount
    Return SetError(0, $iItemCount, $aArray)
EndFunc   ;==>_FileListToArray_EverythingSearch

I use "Everything" search engine. Also use @Nine's SearchContent script.

I wanted to get the file list from _FileListToArray_EverythingSearch() instead of from _FileListToArrayRec(). So I cooked this ( actually a copy'n'paste from elsewhere ) to "eat my cake and have it too".

Also, in the search filter of everything, you can replace the ";" separator with "|" ( a pipe ) and use it in everything search engine. Ex: "*.au3|*.txt|*.log|*.ini|*conf  C: \includes\"

Not a revolutionary new way to do anything but I wanted to share the idea :) 

 

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Posted

"Everything" is a powerful engine, incorporating it into AutoIt is welcome.

your function however does not receive search criteria? as i understand, it depends on your manual search in the Everything GUI, and only retrieves its results to an array?

also, are you aware Everything has a CLI? it is probably easier and safer to manipulate, and most definitely easier to pass search criteria to.

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

WinPose - simultaneous fluent move and resize

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

Magic Math - a math puzzle

Demos:

Title Bar Menu - click the window title to pop-up a menu

 

Posted

hmm, my everything GUI is always open. I can look and see, if what am seeing is what am looking for.
If I use the CLI then I'd have to show it in my GUI's script and that makes little sense, having to code what is already there.

Since I wanted to use the findings of "Everything", to read each of those files ( via SearchContents.au3 ), then I think that just getting the file list from their Listview is practical, and all I need is to use the function I posted. Otherwise I'd have to write a whole new script.

And am aware of their CLI to the point of asking for an AutoIt IPC to it.

I actually use their http interface to pull the data from their DB in some scripts.
Also have a few NAS and more than a few VMs. And if I reboot my PC, on startup Everything is going to update it's DB on millions of files over 3 NAS, so, I have a VM that's always on and get the searches from that remote instance.

Gotta say, I love that Everything search engine.

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...