Open Everything GUI results with TC LOADLIST

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Open Everything GUI results with TC LOADLIST

Post by *Horst.Epp »

Description updated on 14.10.2022 for TC version 10.52 RC3
The included AHK script requires at least TC 10.52 RC1.

With the help of user Highend from the XYplorer forum and user Ovg in this forum
we made an Autohotkey script and procedure which stores the results of the Everything GUI
into a text file and lets TC automatically load the results.

All pathnames below are from my environment and may be freely changed.

Download the AHK script from the Code section below.
and place it in a sub-dir of TC ( C:\Tools\Wincmd\Scripts\ExportEverythingWindow.ahk ).

Compile the script by right clicking the ahk file and select "Compile Script".
Assign a hotkey to the compiled script ( ExportEverythingWindow.exe ) or pin it to the taskbar.

Steps for automatic loading the Everything GUI results from a file with TCs LOADLIST:

1. Create a sub-dir inside of TC home for just this purpose ( C:\Tools\Wincmd\Scripts\Results )
The file Everything.txt results will be stored here.

2. Create an Auto Switch mode which triggers when the dir from step 1 is opened
and sets the View mode "Branch View"

3. Set the Branch view as follows:
- Sort order: Unchanged
- Auto-run commands: *|cm_SrcViewMode0

4. Run the script once and edit the created ini file to make any necessary option changes.
(No need to recompile the script for changing any options)

Parameters: (Set in the ini file ExportEverythingWindow.ini after first run of the script)
DestinationFile
- Where to save the output ( C:\Tools\Wincmd\Scripts\Results\Everything.txt )
EverythingColumnPositions (Default: 2,1)
- The columns 'Name' and 'Path' (must be visible in the Everything GUI)
- 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 the results to TC
UseInstance (empty to use default instance)
- Name of the Everything instance to be used for closing the GUI
Everything
- Full path to Everything (Default C:\Tools\Everything\Everything64.exe)
TotalCmd
- Full path to Total Commander (Default C:\Tools\Wincmd\totalcmd64.exe)

Usage:
Start Everything GUI and search your files.
Hit the hotkey or execute the compiled AHK script from the taskbar.
The script creates the Everything.txt result file
and executes Total Commander with the parameters /O /T /S LOADLIST:Path_to_Dir_from_Step1\Everything.txt
LOADLIST is started and the results are displayed as a TC Branch View without any further user action.

Below the Autohotkey file
Stored for me under C:\Tools\Wincmd\Scripts\ExportEverythingWindow.ahk
Spoiler

Code: Select all

; Transfer Everything GUI results to TC
; Authors: Horst.Epp & Ovg
; Last modified: 04.10.2022 (Updated for TC 10.52 RC1)
 
; 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
}

Last edited by Horst.Epp on 2022-10-15, 13:30 UTC, edited 45 times in total.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
User avatar
Ovg
Power Member
Power Member
Posts: 756
Joined: 2014-01-06, 16:26 UTC

Re: Open Everything GUI results with TC LOADLIST

Post by *Ovg »

2Horst.Epp

Thanks for that!

One note:
I think that lines

Code: Select all

run "C:\Tools\Everything\Everything64.exe" -close
run "C:\Tools\Wincmd\totalcmd64.exe" /O /T /S C:\Tools\Wincmd\Test\
should be right after

Code: Select all

FileAppend, % fullContent, % DestinationFile, UTF-16
before

Code: Select all

else
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Open Everything GUI results with TC LOADLIST

Post by *Horst.Epp »

2Ovg
You are right its the better place.
I have corrected the 1 post.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
User avatar
Ovg
Power Member
Power Member
Posts: 756
Joined: 2014-01-06, 16:26 UTC

Re: Open Everything GUI results with TC LOADLIST

Post by *Ovg »

2Horst.Epp
:thumbsup:
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
User avatar
Ovg
Power Member
Power Member
Posts: 756
Joined: 2014-01-06, 16:26 UTC

Re: Open Everything GUI results with TC LOADLIST

Post by *Ovg »

Horst.Epp wrote: 2021-10-10, 17:58 UTC Beware that TC currently has a problem to read directory entries without a backslash at the end.
Please let me know what is the problem, for me working fine without backslashes...
Am I missing something?
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
User avatar
tuska
Power Member
Power Member
Posts: 3741
Joined: 2007-05-21, 12:17 UTC

Re: Open Everything GUI results with TC LOADLIST

Post by *tuska »

2Horst.Epp
Thank you for sharing the script and your hints regarding automation in Total Commander. :)
Unfortunately, I have a problem with the implementation.

In the script I made the following adjustments to these values (maybe there is already a mistake?):
  • DestinationFile=D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\EV-Results\EV-Results.txt
  • IniRead, DestinationFile, % iniFile, General, DestinationFile, % A_Temp "\~EV-Results.txt"
  • DestinationFile := A_Temp "\~EV-Results.txt"
  • run "D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\TOTALCMD64.EXE" /O /T /S D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\EV-Results\
In Everything I have entered "usercmd.ini" as a search term and Everything is open.
After executing the AHK script, I get the following error message:
"Open_Everything_GUI_results_with_TC LOADLIST.exe -> Fatal error: Everything window does not exist!"
When I open the folder "EV-Results" in TC, I get this error message:
"<Error!>: File not found! D:\Daten\Programme\Tota...\...\EV-Results.txt"
namely because the file "EV-Results.txt" was not created there.

Therefore I ask for support.

PS:
"... Also change the path to Everythingx64.exe" should be "Everything64.exe"
Open_Everything_GUI_results_with_TC LOADLIST.AHK

Code: Select all

;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

SetTitleMatchMode, RegEx

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

if not (FileExist(iniFile)) {
    iniContent :="
    ( LTrim
        [General]
        ; Where to save the output (full path)
        DestinationFile=D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\EV-Results\EV-Results.txt

        ; The columns 'Name' and 'Path' must be visible in the Everything
        ; window. The first value is the position of the 'Path', the second
        ; value is the position of the 'Name' column
        ; Default: 2,1
        EverythingColumnPositions=2,1
    )"
    FileAppend, % iniContent, % iniFile, UTF-16
}

IniRead, DestinationFile,           % iniFile, General, DestinationFile,           % A_Temp "\~EV-Results.txt"
IniRead, EverythingColumnPositions, % iniFile, General, EverythingColumnPositions, 2`,1

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

; Force default value if none is given (or path doesn't exist)
SplitPath, DestinationFile, , dstPath
if (DestinationFile = "" || !InStr(FileExist(dstPath), "D")) {
    DestinationFile := A_Temp "\~EV-Results.txt"
}
if (EverythingColumnPositions = "" || !InStr(EverythingColumnPositions, ",")) {
    EverythingColumnPositions := "2,1"
}
;OutputDebug, % "DestinationFile: " DestinationFile

columnArray := StrSplit(EverythingColumnPositions, ",")


hWnd := WinExist("im).*?Everything$ ahk_class EVERYTHING")
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  := ""

            ; Loop over column(s)
            Loop, Parse, A_LoopField, % A_Tab
            {
                colID   := A_Index
                content := A_LoopField

                if (colID = columnArray[1]) {
                    path := content
                } else if (colID = columnArray[2]) {
                    name := content
                }
                ;OutputDebug, % "row: " rowID " | col: " colID " | content: " content
            }
            if (path && name) {
                full        := path "\" name
                fullContent .= full "`n"
                ;OutputDebug, % "file: " full
            } else if (path) {
                full        := path
                fullContent .= full "`n"
                ;OutputDebug, % "path: " full
            }
        }
    }
    if (FileExist(DestinationFile))
        FileDelete, % DestinationFile

    FileAppend, % fullContent, % DestinationFile, UTF-16

   run "C:\Tools\Everything\Everything64.exe" -close
   run "D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\TOTALCMD64.EXE" /O /T /S D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\EV-Results\

; No Everything window visible
} else {
    Msgbox, 16, Fatal error, Everything window does not exist!
}
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
}
Open_Everything_GUI_results_with_TC LOADLIST.ini

Code: Select all

[General]
; Where to save the output (full path)
DestinationFile=D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\EV-Results\EV-Results.txt

; The columns 'Name' and 'Path' must be visible in the Everything
; window. The first value is the position of the 'Path', the second
; value is the position of the 'Name' column
; Default: 2,1
EverythingColumnPositions=2,1
usercmd.ini

Code: Select all

[em_LOAD_EV-Results]
button=
cmd=LOADLIST D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\EV-Results\EV-Results.txt
menu=LOADLIST D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\EV-Results\EV-Results.txt|https://www.ghisler.ch/board/viewtopic.php?t=75439
wincmd.ini

Code: Select all

[ViewModes]
57_name=EV-Results
57_icon=
57_commands=em_LOAD_EV-Results,cm_DirBranch
57_options=-1|0|0||-1|-1|-1|-1|-1

[ViewModeSwitch]
Enabled=1
28_rules=+%COMMANDER_PATH%\EV-Results\
28_mode=57
Search result list in Everything

Code: Select all

D:\Daten\Programme\TotalCommander\TCD_Programmversionen\VORVERSION_zur_aktuellen_Version\COMMANDER_PATH\usercmd.ini
D:\Daten\Programme\TotalCommander\TCD_Programmversionen\VORVERSION_zur_aktuellen_Version\Tests\usercmd.ini
D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\usercmd.ini
D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\Migration\Installation_Update_Upgrade\Backup\usercmd.ini
D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\Tests\usercmd.ini
D:\TC\usercmd.ini
D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\Migration\Installation_Update_Upgrade\usercmd.ini.lnk
D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\EV-Results\EV-Results.txt - MANUALLY created!

Code: Select all

Filename,Size,Date Modified,Date Created,Attributes,"Title","Subject","Tags","Comment","Authors"
"D:\Daten\Programme\TotalCommander\TCD_Programmversionen\VORVERSION_zur_aktuellen_Version\COMMANDER_PATH\usercmd.ini",23343,132562586104916114,130299620350693791,32,"","","","",""
"D:\Daten\Programme\TotalCommander\TCD_Programmversionen\VORVERSION_zur_aktuellen_Version\Tests\usercmd.ini",78,131596653064552834,131596653064552834,32,"","","","",""
"D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\usercmd.ini",24650,132784278087428709,130299620350693791,32,"","","","",""
"D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\Migration\Installation_Update_Upgrade\Backup\usercmd.ini",4055,130995725971078062,130299620350693791,32,"","","","",""
"D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\Tests\usercmd.ini",78,131596653064552834,131596653064552834,32,"","","","",""
"D:\TC\usercmd.ini",7997,131663015226039094,131665360522576708,32,"","","","",""
"D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\Migration\Installation_Update_Upgrade\usercmd.ini.lnk",1309,131000985552712437,131000985552712437,32,"","","","",""
Last edited by tuska on 2021-10-11, 14:41 UTC, edited 1 time in total.
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Open Everything GUI results with TC LOADLIST

Post by *petermad »

Ovg wrote: 2021-10-11, 13:44 UTC
Horst.Epp wrote: 2021-10-10, 17:58 UTC Beware that TC currently has a problem to read directory entries without a backslash at the end.
Please let me know what is the problem, for me working fine without backslashes...
Am I missing something?
See: viewtopic.php?p=406079#p406079
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
tuska
Power Member
Power Member
Posts: 3741
Joined: 2007-05-21, 12:17 UTC

Re: Open Everything GUI results with TC LOADLIST

Post by *tuska »

2Horst.Epp

Sorry, the file D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\EV-Results\EV-Results.txt
was created in UTF-8 format.
"FileAppend, % iniContent, % iniFile, UTF-16"
The file EV-Results.txt can be displayed in Windows Explorer (also in the preview) - but not in TC!
The file can be opened in Windows Explorer with an editor.

It is interesting that part of the content of the file is displayed in the error message when you try to open the directory.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Open Everything GUI results with TC LOADLIST

Post by *Horst.Epp »

tuska wrote: 2021-10-11, 15:29 UTC 2Horst.Epp

Sorry, the file D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\EV-Results\EV-Results.txt
was created in UTF-8 format.
"FileAppend, % iniContent, % iniFile, UTF-16"
The file EV-Results.txt can be displayed in Windows Explorer (also in the preview) - but not in TC!
The file can be opened in Windows Explorer with an editor.

It is interesting that part of the content of the file is displayed in the error message when you try to open the directory.
2tuska
I have no problems to view UTF-8 format in TC using CudaLister or ULister.
The file must be UTF-8 or UTF-16 to handle non ascii characters.
The problem with NoNulls script is that only the first line of the GUI is written to the file.
My solution from Highend works perfect, uses UTF-16 LE BOM and copies all lines from the GUI result.
So finally we have to wait for Everything option or Christians change of LOADLIST.
Whatever comes first will solve the current problems.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
User avatar
tuska
Power Member
Power Member
Posts: 3741
Joined: 2007-05-21, 12:17 UTC

Re: Open Everything GUI results with TC LOADLIST

Post by *tuska »

Horst.Epp wrote: 2021-10-11, 15:41 UTC My solution from Highend works perfect, uses UTF-16 LE BOM and copies all lines from the GUI result.
Thank you for your information.
Then it will be difficult for me, because the above script does not work for me or I am doing something else wrong.

Maybe someone else has an idea where my fault is.
This is what I did... German

Code: Select all

1. Create a sub-dir inside of TC home for just this purpose.
   E.g. %COMMANDER_PATH%\EV-Results\ ... entspricht bei mir: D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\EV-Results\

2. Create em_LoadEvResult in Usercmd.ini with command LOADLIST and as parameter the full path-name of the Everything results file.
   LOADLIST <filename>	 Lade komplette Liste (wie Suchresultat) aus Datei
   ; .AHK ... DestinationFile=D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\EV-Results\EV-Results.txt
   LOADLIST D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\EV-Results\EV-Results.txt
   usercmd.ini
   [em_LOAD_EV-Results]
   button=
   cmd=LOADLIST D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\EV-Results\EV-Results.txt
   menu=LOADLIST D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\EV-Results\EV-Results.txt|https://www.ghisler.ch/board/viewtopic.php?t=75439

3. Create a View mode named Ev_Results which sets the Columns view to Branch View and the Auto-run command to em_LoadEvResult
   cm_DirBranch	2026	Zweigansicht: Alle Dateien in allen Unterverzeichnissen
   Konfigurieren -> Einstellungen... -> Ansichtsmodus -> Button "Hinzufügen...": EV-Results (<- Ansichtsmodus hinzufügen)
   Name des Ansichtsmodus: EV-Results
   Spaltenansicht:
   Sortierreihenfolge:
   Befehle auto-starten: em_LOAD_EV-Results,cm_DirBranch (wrong)
   Befehle auto-starten: em_LOAD_EV-Results    (correct)   
   Button "OK" anklicken.

4. Create an Auto Switch mode which triggers when the dir from step 1 is opened and sets the View mode Ev_Results
   Konfigurieren -> Einstellungen... -> Auto Modus wechseln
   [✓] Bei Verzeichniswechsel automatisch Ansichtsmodus wechseln
   Button "Hinzufügen..." drücken
   Regel -> +: Muss übereinstimmen - Verzeichnis -> %COMMANDER_PATH%\EV-Results\
   Diesen Modus setzen: Klick auf Dropdown-Pfeil ... EV-Results auswählen (dies ist der Name des Ansichtsmodus)
   Button "OK" anklicken.

5. [url=https://www.autohotkey.com/download/]AutoHotkey - Download[/url]
   Current version: v1.1.33.10 - August 29, 2021

   - Code speichern, zB unter Dateiname: Open_Everything_GUI_results_with_TC LOADLIST.AHK
   - Code ändern, und zwar
     a) ; Where to save the output (full path) ... Wo bzw. in welcher Datei soll das Suchergebnis gespeichert werden? z.B. ...
        DestinationFile=D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\EV-Results\EV-Results.txt
     b) Ggf. folgende Änderung vornehmen, zB
        VON: IniRead, DestinationFile,           % iniFile, General, DestinationFile,           % A_Temp "\~Everything.txt"
        AUF: IniRead, DestinationFile,           % iniFile, General, DestinationFile,           % A_Temp "\~EV-Results.txt"
     c) Ggf. folgende Änderung vornehmen, zB
        VON: DestinationFile := A_Temp "\~Everything.txt"
        AUF: DestinationFile := A_Temp "\~EV-Results.txt"
     d) Pfad gegebenenfalls anpassen für Everything64.exe und TOTALCMD64.EXE, zB
        VON: run "C:\Tools\Everything\Everything64.exe" -close
        AUF: run "C:\Tools\Everything\Everything64.exe" -close
        VON: run "C:\Tools\Wincmd\totalcmd64.exe" /O /T /S C:\Tools\Wincmd\Test\
        AUF: run "D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\TOTALCMD64.EXE" /O /T /S D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\EV-Results\

   - Compile the script and assign an hotkey to it (I use QAP to do that). -> .AHK-Datei kompilieren ...
     a) %COMMANDER_PATH%\Tools\AutoHotkey\Compiler\Ahk2Exe.exe ausführen per Doppelklick auf die Datei
     b) Source (script file): .. Button "Browse" anklicken
     c) Navigieren zu der .AHK Skriptdatei - in diesem Fall: Open_Everything_GUI_results_with_TC LOADLIST.AHK
        im Ordner %COMMANDER_PATH%\Tools\AutoHotkey\Skripte\ und die .AHK-Datei anklicken.
        Diese Datei (bzw. zumindest der Pfad) wird nun im Feld "Source (script file):" angezeigt.
     d) Destination (.exe file): Button "Browse" anklicken
     e) In den Ordner navigieren, in dem sich die zu kompilierende .AHK-Datei befindet
     f) Folgenden Dateinamen angeben: Open_Everything_GUI_results_with_TC LOADLIST.exe
        (als Dateityp wird "Executable files (*.exe)" angezeigt)
     g) Button "Speichern" anklicken
     h) Option -> Custom Icon (.ico file): Button "Browse" anklicken
        Navigieren zB zu folgendem Ordner: %COMMANDER_PATH%\Tools\AutoHotkey\Icons
        Icon "Rot_S.ico" auswählen
     h) Convert to executable: Button > Convert < anklicken.
        Es erscheint folgende Meldung im Fenster "Ahk2Exe" ... "Successfully compiled:
        D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\Tools\AutoHotkey\Skripte\Open_Everything_GUI_results_with_TC LOADLIST.exe"
     i) Fenster "Ahk2Exe for AutoHotkey v1.1.33.10 -- Script to EXE Converter" schließen (File - Exit ALT-F4)
     j) Nach dem ersten Aufruf der Open_Everything_GUI_results_with_TC LOADLIST.exe
        wird diese Datei angelegt: Open_Everything_GUI_results_with_TC LOADLIST.ini - will be created automatically -
     k) Siehe auch Pkt. h) ... Option -> Custom Icon (.ico file): Es ist ein TC-Neustart erforderlich, um ein AHK-Icon
        ersichtlich zu machen, welches vom Standard-Icon abweicht.

     Open_Everything_GUI_results_with_TC LOADLIST.exe -> Fatal error: Everything window does not exist!
     Öffnen des Ordners "EV-Results" -> <Fehler!>: Datei nicht gefunden! D:\Daten\Programme\Tota...\...\EV-Results.txt
EDIT:
View mode: EV-Results
Auto-run commands: Changed...

Code: Select all

FROM: em_LOAD_EV-Results,cm_DirBranch (wrong)
TO  : em_LOAD_EV-Results              (correct)
Last edited by tuska on 2021-10-11, 22:43 UTC, edited 1 time in total.
User avatar
tuska
Power Member
Power Member
Posts: 3741
Joined: 2007-05-21, 12:17 UTC

Re: Open Everything GUI results with TC LOADLIST

Post by *tuska »

Code: Select all

LOADLIST "D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\EV-Results\EV-Results.txt"
-OR-
LOADLIST D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\EV-Results\EV-Results.txt
... <ENTER> in the TC-commandline does not find the file !?
(The file is visible in Windows Explorer - UTF-16 LE-BOM - Notepad++ v8.1.5 (64-bit)).

Is that my fault now?
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Open Everything GUI results with TC LOADLIST

Post by *Horst.Epp »

tuska wrote: 2021-10-11, 15:48 UTC
Horst.Epp wrote: 2021-10-11, 15:41 UTC My solution from Highend works perfect, uses UTF-16 LE BOM and copies all lines from the GUI result.
Thank you for your information.
Then it will be difficult for me, because the above script does not work for me or I am doing something else wrong.

Maybe someone else has an idea where my fault is.
This is what I did... German

Code: Select all

1. Create a sub-dir inside of TC home for just this purpose.
   E.g. %COMMANDER_PATH%\EV-Results\ ... entspricht bei mir: D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\EV-Results\

2. Create em_LoadEvResult in Usercmd.ini with command LOADLIST and as parameter the full path-name of the Everything results file.
   LOADLIST <filename>	 Lade komplette Liste (wie Suchresultat) aus Datei
   ; .AHK ... DestinationFile=D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\EV-Results\EV-Results.txt
   LOADLIST D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\EV-Results\EV-Results.txt
   usercmd.ini
   [em_LOAD_EV-Results]
   button=
   cmd=LOADLIST D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\EV-Results\EV-Results.txt
   menu=LOADLIST D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\EV-Results\EV-Results.txt|https://www.ghisler.ch/board/viewtopic.php?t=75439

3. Create a View mode named Ev_Results which sets the Columns view to Branch View and the Auto-run command to em_LoadEvResult
   cm_DirBranch	2026	Zweigansicht: Alle Dateien in allen Unterverzeichnissen
   Konfigurieren -> Einstellungen... -> Ansichtsmodus -> Button "Hinzufügen...": EV-Results (<- Ansichtsmodus hinzufügen)
   Name des Ansichtsmodus: EV-Results
   Spaltenansicht:
   Sortierreihenfolge:
   Befehle auto-starten: em_LOAD_EV-Results,cm_DirBranch
   Button "OK" anklicken.

4. Create an Auto Switch mode which triggers when the dir from step 1 is opened and sets the View mode Ev_Results
   Konfigurieren -> Einstellungen... -> Auto Modus wechseln
   [✓] Bei Verzeichniswechsel automatisch Ansichtsmodus wechseln
   Button "Hinzufügen..." drücken
   Regel -> +: Muss übereinstimmen - Verzeichnis -> %COMMANDER_PATH%\EV-Results\
   Diesen Modus setzen: Klick auf Dropdown-Pfeil ... EV-Results auswählen (dies ist der Name des Ansichtsmodus)
   Button "OK" anklicken.

5. [url=https://www.autohotkey.com/download/]AutoHotkey - Download[/url]
   Current version: v1.1.33.10 - August 29, 2021

   - Code speichern, zB unter Dateiname: Open_Everything_GUI_results_with_TC LOADLIST.AHK
   - Code ändern, und zwar
     a) ; Where to save the output (full path) ... Wo bzw. in welcher Datei soll das Suchergebnis gespeichert werden? z.B. ...
        DestinationFile=D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\EV-Results\EV-Results.txt
     b) Ggf. folgende Änderung vornehmen, zB
        VON: IniRead, DestinationFile,           % iniFile, General, DestinationFile,           % A_Temp "\~Everything.txt"
        AUF: IniRead, DestinationFile,           % iniFile, General, DestinationFile,           % A_Temp "\~EV-Results.txt"
     c) Ggf. folgende Änderung vornehmen, zB
        VON: DestinationFile := A_Temp "\~Everything.txt"
        AUF: DestinationFile := A_Temp "\~EV-Results.txt"
     d) Pfad gegebenenfalls anpassen für Everything64.exe und TOTALCMD64.EXE, zB
        VON: run "C:\Tools\Everything\Everything64.exe" -close
        AUF: run "C:\Tools\Everything\Everything64.exe" -close
        VON: run "C:\Tools\Wincmd\totalcmd64.exe" /O /T /S C:\Tools\Wincmd\Test\
        AUF: run "D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\TOTALCMD64.EXE" /O /T /S D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\EV-Results\

   - Compile the script and assign an hotkey to it (I use QAP to do that). -> .AHK-Datei kompilieren ...
     a) %COMMANDER_PATH%\Tools\AutoHotkey\Compiler\Ahk2Exe.exe ausführen per Doppelklick auf die Datei
     b) Source (script file): .. Button "Browse" anklicken
     c) Navigieren zu der .AHK Skriptdatei - in diesem Fall: Open_Everything_GUI_results_with_TC LOADLIST.AHK
        im Ordner %COMMANDER_PATH%\Tools\AutoHotkey\Skripte\ und die .AHK-Datei anklicken.
        Diese Datei (bzw. zumindest der Pfad) wird nun im Feld "Source (script file):" angezeigt.
     d) Destination (.exe file): Button "Browse" anklicken
     e) In den Ordner navigieren, in dem sich die zu kompilierende .AHK-Datei befindet
     f) Folgenden Dateinamen angeben: Open_Everything_GUI_results_with_TC LOADLIST.exe
        (als Dateityp wird "Executable files (*.exe)" angezeigt)
     g) Button "Speichern" anklicken
     h) Option -> Custom Icon (.ico file): Button "Browse" anklicken
        Navigieren zB zu folgendem Ordner: %COMMANDER_PATH%\Tools\AutoHotkey\Icons
        Icon "Rot_S.ico" auswählen
     h) Convert to executable: Button > Convert < anklicken.
        Es erscheint folgende Meldung im Fenster "Ahk2Exe" ... "Successfully compiled:
        D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\Tools\AutoHotkey\Skripte\Open_Everything_GUI_results_with_TC LOADLIST.exe"
     i) Fenster "Ahk2Exe for AutoHotkey v1.1.33.10 -- Script to EXE Converter" schließen (File - Exit ALT-F4)
     j) Nach dem ersten Aufruf der Open_Everything_GUI_results_with_TC LOADLIST.exe
        wird diese Datei angelegt: Open_Everything_GUI_results_with_TC LOADLIST.ini - will be created automatically -
     k) Siehe auch Pkt. h) ... Option -> Custom Icon (.ico file): Es ist ein TC-Neustart erforderlich, um ein AHK-Icon
        ersichtlich zu machen, welches vom Standard-Icon abweicht.

     Open_Everything_GUI_results_with_TC LOADLIST.exe -> Fatal error: Everything window does not exist!
     Öffnen des Ordners "EV-Results" -> <Fehler!>: Datei nicht gefunden! D:\Daten\Programme\Tota...\...\EV-Results.txt
In your case the script does not found a running Everything instance
and there is no result file created of course.
I use Everything 1.5 without an alpha instance so the script founds the handle of it.
So you have not running Everything or there is no handle which can be found by
hWnd := WinExist("im).*?Everything$ ahk_class EVERYTHING")
If your handle is another one you have to change this line in the AHK.
I check this with the AU3_Spy.exe from Autohotkey.
Also compiling the script is just an right click on the AHK file and select Compile Script.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
User avatar
Ovg
Power Member
Power Member
Posts: 756
Joined: 2014-01-06, 16:26 UTC

Re: Open Everything GUI results with TC LOADLIST

Post by *Ovg »

2petermad
Thanks, I'll try it :-)

2tuska
Remove $ from

Code: Select all

 hWnd := WinExist("im).*?Everything$ ahk_class EVERYTHING")
and try again
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Open Everything GUI results with TC LOADLIST

Post by *Horst.Epp »

tuska wrote: 2021-10-11, 16:14 UTC

Code: Select all

LOADLIST "D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\EV-Results\EV-Results.txt"
-OR-
LOADLIST D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\EV-Results\EV-Results.txt
... <ENTER> in the TC-commandline does not find the file !?
(The file is visible in Windows Explorer - UTF-16 LE-BOM - Notepad++ v8.1.5 (64-bit)).

Is that my fault now?
LOADLIST with a parameter from the command line doesn't work and is not of any use here.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Open Everything GUI results with TC LOADLIST

Post by *Horst.Epp »

Ovg wrote: 2021-10-11, 16:46 UTC 2petermad
Thanks, I'll try it :-)

2tuska
Remove $ from

Code: Select all

 hWnd := WinExist("im).*?Everything$ ahk_class EVERYTHING")
and try again
2ovg
Thanks for the tip.
I changed the code in first post to also catch Everything Alpha instances.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
Post Reply