How to export the results in the current GUI filelist

Discussion related to "Everything" 1.5 Alpha.
Post Reply
yahuu
Posts: 10
Joined: Wed Jul 24, 2024 9:56 am

How to export the results in the current GUI filelist

Post by yahuu »

Can ev export the results in the current GUI filelist through commands? If I use es.exe, I still need to enter the search conditions once in the command line.

The function I want is to execute a command after the search is completed in the interface and output the current results as a text
void
Developer
Posts: 16665
Joined: Fri Oct 16, 2009 11:31 pm

Re: How to export the results in the current GUI filelist

Post by void »

There's no command line option to export the current GUI results.

To export your results:
  • From the File menu, click Export....
  • Change Save as type to: TXT Text Files (*.txt).


Ctrl + Shift + C = Copy the full path and name.
/copy (add to a bookmark to copy with your own custom formatting)
File -> Copy Property -> Copy as TSV (bind an optional keyboard shortcut)
You could do something from the command line with -bookmark <bookmark-name> or -command <id> to copy names to the clipboard or show the export dialog.
yahuu
Posts: 10
Joined: Wed Jul 24, 2024 9:56 am

Re: How to export the results in the current GUI filelist

Post by yahuu »

Thank you, I know how to export manually on the interface.
I want to silently export the current GUI results as text, and then load it as a list in Totalcmd, so I want a command that can directly export the interface search results.
void
Developer
Posts: 16665
Joined: Fri Oct 16, 2009 11:31 pm

Re: How to export the results in the current GUI filelist

Post by void »

Currently not possible, sorry.

I will consider an Everything.exe -export command line option.
Thank you for the suggestion.
horst.epp
Posts: 1443
Joined: Fri Apr 04, 2014 3:24 pm

Re: How to export the results in the current GUI filelist

Post by horst.epp »

yahuu wrote: Wed Jul 24, 2024 10:02 am Can ev export the results in the current GUI filelist through commands? If I use es.exe, I still need to enter the search conditions once in the command line.

The function I want is to execute a command after the search is completed in the interface and output the current results as a text
I have an AHK script which generates a txt file from the current GUI results.
Using it to load the results into file managers like Total Commander and Free Commander.
You can modify it for your needs.

Code: Select all

; Transfer Everything GUI results to TC
; Authors: Horst.Epp & Ovg (based on a script from user Highend in XYplorer forum)
; Last modified: 04.10.2022 (Changed regex by Ovg)
 
; https://www.ghisler.ch/board/viewtopic.php?t=75439 ...... Open Everything GUI results with TC LOADLIST
; https://www.ghisler.ch/board/viewtopic.php?t=75417 ...... LOADLIST command and UTF8 file lists
; https://www.voidtools.com/forum/viewtopic.php?f=4&t=10594 Send ResultsList to Total Commander

; Build AutoHotkey_L
; Build x64
; Build Kill=true
; Build Zip=false
; Build Run=true

#NoEnv
;#Persistent
#SingleInstance Force
SetBatchLines, -1

; Create / read .ini file settings
SetTitleMatchMode, RegEx
iniFile := RegExReplace(A_ScriptFullPath, "(ahk|exe)$", "ini")

if not (FileExist(iniFile)) {
    iniContent :="
    (( LTrim
        [General]
	; DestinationFile
        ;    Where to save the output (full path to DestinationFile.txt)
        ; EverythingColumnPositions (Default: 2,1)
	;    The columns 'Name' and 'Path' must be visible in the Everything GUI Window
        ;    The first value is the position of the 'Path' column
        ;    The second value is the position of the 'Name' column
	; CloseEverything (Default 1 for yes)
	;    Should Everything GUI window be closed after transfering to TC
	; UseInstance (Empty for default instance)
        ;    Name of the Everything instance to be used for closing the GUI 

; The contents of the following lines must be adjusted if necessary, e.g. path and parameter adjustments.
;********************************************************************************************************
        DestinationFile = C:\Tools\Wincmd\Scripts\Results\Everything.txt
        EverythingColumnPositions=2,1
        AddEndSlash = 1
        CloseEverything = 1
        UseInstance =
        Everything = C:\Tools\Everything\Everything64.exe
        TotalCmd = C:\Tools\Wincmd\totalcmd64.exe
;********************************************************************************************************

    )"
    FileAppend, % iniContent, % iniFile, UTF-16
}
IniRead, DestinationFile, % iniFile, General, DestinationFile, %A_Space%
IniRead, EverythingColumnPositions, % iniFile, General, EverythingColumnPositions, 2`,1

IniRead, AddEndSlash, % iniFile, General, AddEndSlash, 1
IniWrite, %AddEndSlash%, % iniFile, General, AddEndSlash
IniRead, CloseEverything, % iniFile, General, CloseEverything, 1
IniWrite, %CloseEverything%, % iniFile, General, CloseEverything
IniRead, UseInstance, % iniFile, General, UseInstance, %A_Space%
IniWrite, %UseInstance%, % iniFile, General, UseInstance

IniRead, Everything, % iniFile, General, Everything, "C:\Tools\Everything\Everything64.exe"
IniRead, TotalCmd, % iniFile, General, TotalCmd, "C:\Tools\Wincmd\totalcmd64.exe"

DestinationFile           := ResolveEnvVars(DestinationFile)
EverythingColumnPositions := StrReplace(EverythingColumnPositions, " ")

; Force error if none is given (or path doesn't exist)
SplitPath, DestinationFile, , dstPath
if (DestinationFile = "" || !InStr(FileExist(dstPath), "D")) {
    Msgbox, 16, Fatal error, Destination file definition is missing or illegal named !
    Return
}
if (EverythingColumnPositions = "" || !InStr(EverythingColumnPositions, ",")) {
    EverythingColumnPositions := "2,1"
}

columnArray := StrSplit(EverythingColumnPositions, ",")

hWnd := WinExist("ahk_exe Everything(?:\d\d)*\.exe")

if hWnd
{
  ControlGet, winContent, List, , SysListView321, % "ahk_id" hWnd

  if (winContent)
  {
    fullContent := ""
;   Loop over row(s)
    Loop, Parse, winContent, `n
    {
      rowID := A_Index
      path  := ""
      name  := ""
      full  := ""
      Bad := 2
;     Loop over column(s)
      Loop, Parse, A_LoopField, % A_Tab
      {
        colID   := A_Index
        content := A_LoopField
        If (colID > columnArray[1] And colID > columnArray[2])
        {
          Break
        }
        Else
        {
          If (colID = columnArray[1])
          {
;	    If !RegExMatch(content,"i)^[a-z]:|\\\.*?\\")
	    If !RegExMatch(content,"i)^(?:[a-z]:|\\\.*?\\)")
            {
              Break
            }
            path := content
            Bad -= 1
            If !RegExMatch(path,"\\$")
            {
              path := path . "\"
            }
          }
          Else if (colID = columnArray[2])
          {
            If content is Space
            {
              Break
            }
            name := content
            Bad -= 1
          }
        }
      }
      If (Bad == 0)
      {
        full        := path . name
        If InStr(FileExist(full), "D")
        {
          if (AddEndSlash == 1)
          {
            if !RegExMatch(full,"\\$")
            {
              full := full . "\"
            }
          }
          Else
          {
            If RegExMatch(full,"\\$")
            {
              full := SubStr(full,1,StrLen(full)-1)
            }
          }
        }
        fullContent .= full "`n"
      }
    }
    fullContent := RegExReplace(fullContent,"\R$","")
    If (FileExist(DestinationFile))
      FileDelete, % DestinationFile

        FileAppend, % fullContent, % DestinationFile, UTF-16

	DestinationDir := SubStr(DestinationFile,1,InStr(DestinationFile, "\",,-1))
	Run %TotalCmd% /O /T /S LOADLIST:%DestinationFile%
	If (CloseEverything) {
             run %Everything% -instance "%UseInstance%" -close
	}
    }
    Else
;   Empty search result
    {
      Msgbox, 16,, Search result is Empty, Nothing to do ...
    }
; No Everything window visible
} Else {
    Msgbox, 16, Fatal error, Everything window does not exist!
}
SetTitleMatchMode, 1
return

; ==================================
; = GOTO: FUNCTIONS - ResolveEnvVars
; ==================================
; http://www.autohotkey.com/board/topic/40115-func-envvars-replace-environment-variables-in-text/#entry310601
ResolveEnvVars(str) {
    if sz := DllCall("ExpandEnvironmentStrings", "uint", &str, "uint", 0, "uint", 0)
    {
        VarSetCapacity(dst, A_IsUnicode ? sz * 2 : sz)
        if DllCall("ExpandEnvironmentStrings", "uint", &str, "str", dst, "uint", sz)
            return dst
    }
    return str
}

yahuu
Posts: 10
Joined: Wed Jul 24, 2024 9:56 am

Re: How to export the results in the current GUI filelist

Post by yahuu »

horst.epp wrote: Wed Jul 24, 2024 12:19 pm I have an AHK script which generates a txt file from the current GUI results.
Using it to load the results into file managers like Total Commander and Free Commander.
You can modify it for your needs.
Thank you very much.I am currently implementing it using AHK and feel that the steps are too complicated
yahuu
Posts: 10
Joined: Wed Jul 24, 2024 9:56 am

Re: How to export the results in the current GUI filelist

Post by yahuu »

void wrote: Wed Jul 24, 2024 11:56 am Currently not possible, sorry.

I will consider an Everything.exe -export command line option.
Thank you for the suggestion.
If possible, that would be really great.
Post Reply