viewtopic.php?p=516462#p516462
The code in the link works but is slow and doesn't hide the window, is there a fast way to get the value returned by the Everything tool?
Pass the command line to the program and get the return value
Re: Pass the command line to the program and get the return value
What information are you trying to get?
Re: Pass the command line to the program and get the return value
For example
Code: Select all
#Requires AutoHotkey v2.0.2
es := "C:\Program Files\Everything\es.exe"
folder := "H:\Folders\Pics\"
rand := Random(1, 9)
arg := folder . " !.txt " . rand
RunWait es " " arg " -export-txt " A_Temp "\esOutput.txt", , "Hide"
FileEncoding "UTF-8"
esOutput := FileRead(A_Temp "\esOutput.txt")
if !esOutput
return
myArray := StrSplit(esOutput, "`r`n")
randLine := Random(1, myArray.Length)
msgbox MyArray[randLine]
Re: Pass the command line to the program and get the return value
This took 100-150 ms and showed no command window. It is essentially the same as your script. Nonetheless, if you are looking for text within files, Everything is not designed to do it. By this, I simply mean that the program would need to search within every file, and this process is not fast. Other programs (e.g., dtSearch) are available that index all words in all files and would provide faster output for this type of search.
Code: Select all
#Requires AutoHotkey v2.0
start := A_TickCount
es := A_ProgramFiles '\Everything\es.exe'
es := 'd:\Q\everything\es.exe'
folder := 'H:\Folders\Pics\'
folder := A_ScriptDir
arg := folder ' !.txt ' Random(1, 9)
out := A_Temp '\esOutput.txt'
Try FileRecycle out
RunWait es ' ' arg ' -export-txt ' out,, 'Hide'
; FileEncoding 'UTF-8'
If !esOutput := FileRead(out)
Return
line := StrSplit(esOutput, '`r`n')
randLine := Random(1, line.Length)
MsgBox line[randLine] '`n`nTime elapsed: ' A_TickCount - start ' ms'
Re: Pass the command line to the program and get the return value
if u want speed, use the dll or WM_COPYDATA
Re: Pass the command line to the program and get the return value
Here is some info on the indexing that Windows does. https://support.microsoft.com/en-us/windows/search-indexing-in-windows-10-faq-da061c83-af6b-095c-0f7a-4dfecda4d15a
Who is online
Users browsing this forum: alawsareps, aleksbor, reborn, vmech and 131 guests