Send ResultsList to Total Commander

Have a suggestion for "Everything"? Please post it here.
Post Reply
davidcarta
Posts: 2
Joined: Thu Oct 07, 2021 4:41 pm

Send ResultsList to Total Commander

Post by davidcarta »

I love the fact that voidtools works so well with Total Commander.

However, for fast searches, I always start with Everything, via the shortcut keys.

Once I have my filtered list of files, I often would like to send the ResultsList to Total Commander via a shortcut key.

There may be a way to do this, but I have not yet found it. I can do this directly through Total Commander, but the live searching in the everything window is just so much better. I can imagine that other programs could use this results list as well.
therube
Posts: 4605
Joined: Thu Sep 03, 2009 6:48 pm

Re: Send ResultsList to Total Commander

Post by therube »

In what format does the data need to be in in order to use it?
IOW, does TC offer some sort of "import" function?
davidcarta
Posts: 2
Joined: Thu Oct 07, 2021 4:41 pm

Re: Send ResultsList to Total Commander

Post by davidcarta »

I cross posted to the TC forum to see if Christian Ghisler had a method to "receive" a list of files. I'll update here when/if I get a reply.
NotNull
Posts: 5252
Joined: Wed May 24, 2017 9:22 pm

Re: Send ResultsList to Total Commander

Post by NotNull »

Yes, Total Commander has a LOADLIST command. With some trickery that could be used.
Export Everything results as txt file and use LOADLIST to load those files in what TC calls a listbox.

Will see if I can make that work this weekend, but I hope someone beats me to it, as I do have little time.
tuska
Posts: 921
Joined: Thu Jul 13, 2017 9:14 am

Re: Send ResultsList to Total Commander

Post by tuska »

Everything
- Mark the search results, e.g. files/folder
- Press Ctrl+Shift+C (Copy Full Name to Clipboard) - [Tools - Options... - Keyboard -> Show commands containing: copy]

Total Commander (short: TC)
- Shift+F4 create textfile, e.g. Results.txt, then press "OK"
- Ctrl+V (paste from clipboard), Ctrl+S (Save), Ctrl+W (Close)
- Place cursor on Results.txt
- Press and hold the Ctrl key, click the button below...

Button *)

Code: Select all

TOTALCMD#BAR#DATA
LOADLIST
%P%N
WCMICON2.DLL,47
LOADLIST %P%N|1. Everything: Mark files/folders|2. Copy Full Name to Clipboard|3. TC: Shift+F4 Create textfile|4. Save and close textfile|5. Place cursor on textfile|6. Press and hold the Ctrl key, click on this button = Result list|7. Ctrl+R - Reread Source


-1
*)
You can use the code to create a button as follows:
1. Click on "SELECT ALL" (to the right of CODE:)
2. CTRL + C = Copy to clipboard (press the CTRL-key and hold it down, then press the letter "C")
3. Make a right click on your buttonbar on an empty space [e.g. after the last button or between the buttons]
4. Click on menu item "Paste"
5. Explanation to TOTALCMD#BAR#DATA by Stefan2

- OR -

LOADLIST command (Total Commander)
usercmd.ini

Code: Select all

[em_loadlist]
cmd=LOADLIST
param=%P%N
wincmd.ini
(The section name [Alias] may only exist once in the file "wincmd.ini").

Code: Select all

[Alias]
LOADLIST=em_loadlist
Then you can type: LOADLIST t:\export.txt in the command line ... of Total Commander
Thanks to NotNull! :)

Search results are shown in Total Commander (Display as after pressing the button "Feed to listbox").
Ctrl+R Refresh view -> Search results are removed and the normal view is restored.
_________________________________________________
[See also: Menu "Tools" -> "Options..." -> "Context Menu"]
horst.epp
Posts: 1344
Joined: Fri Apr 04, 2014 3:24 pm

Re: Send ResultsList to Total Commander

Post by horst.epp »

Sorry Tuska, but thats to much work.

The following AHK script (from Notnull if I remember) works in YXplorer and is much easier to handle.
While you have the Everything results on screen
just hit an hotkey and the results are opened in an XYplorer Paper folder.

I hope with the help of Notnull we can have a similar solution which needs just a button in TC
to load the results from Everything with LOADLIST.

Code: Select all

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

#NoEnv
#SingleInstance Force
SetBatchLines, -1

SetTitleMatchMode, RegEx

hWnd := WinExist("im) - Everything$ ahk_class EVERYTHING")
if hWnd {
    ControlGet, winContent, List, , SysListView321, % "ahk_id" hWnd
    if (winContent) {
        fullContent := ""

        ; Get only specific columns, not all!
        ; Path = 2nd column
        ; Name = 1st column
        getCols    := "2,1"
        getColsArr := StrSplit(getCols, ",")

        ; 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 = getColsArr[1]) {
                    path := content
                } else if (colID = getColsArr[2]) {
                    name := content
                }
            }
            if (path && name) {
                full := path "\" name
                fullContent .= full "<::>"
            } else if (path) {
                full := path
                fullContent .= full "<::>"
            }
        }
        if (fullContent)
            fullContent := SubStr(fullContent, 1, StrLen(fullContent) - StrLen("<::>"))

        xyHWnd := WinExist("ahk_class ThunderRT6FormDC")
        if (xyHWnd) {
            xyQueryScript =
            ( LTrim Join
                ::$content = replace("%fullContent%", "<::>", <crlf>);
                    tab("new");
                    paperfolder("paper:Everything", $content, , "nl");
            )
            Send_WM_COPYDATA(xyQueryScript, xyHWnd)
        }
    }
}
return


; ====================================
; = GOTO: FUNCTIONS - Send_WM_COPYDATA
; ====================================
Send_WM_COPYDATA(message, hWnd) {
    size := StrLen(message)
    if !(A_IsUnicode) {
        VarSetCapacity(data, size * 2, 0)
        StrPut(message, &data, size, "UTF-16")
    } else {
        data := message
    }
    VarSetCapacity(COPYDATA, A_PtrSize * 3, 0)
    NumPut(4194305, COPYDATA, 0, "Ptr")
    NumPut(size * 2, COPYDATA, A_PtrSize, "UInt")
    NumPut(&data, COPYDATA, A_PtrSize * 2, "Ptr")
    result := DllCall("User32.dll\SendMessageW", "Ptr", hWnd, "UInt", 74, "Ptr", 0, "Ptr", &COPYDATA, "Ptr")
    return
}
tuska
Posts: 921
Joined: Thu Jul 13, 2017 9:14 am

Re: Send ResultsList to Total Commander

Post by tuska »

horst.epp wrote: Fri Oct 08, 2021 10:06 am Sorry Tuska, but thats too much work.
No problem, I will gladly accept any solution that is much better and leads to success ;)

What do you think about publishing the AHK code in the TC forum too?
An integrated solution in TC would be desirable...
Maybe some food for thought for the author of Total Commander?
horst.epp
Posts: 1344
Joined: Fri Apr 04, 2014 3:24 pm

Re: Send ResultsList to Total Commander

Post by horst.epp »

tuska wrote: Fri Oct 08, 2021 10:40 am
horst.epp wrote: Fri Oct 08, 2021 10:06 am Sorry Tuska, but thats too much work.
No problem, I will gladly accept any solution that is much better and leads to success ;)

What do you think about publishing the AHK code in the TC forum too?
An integrated solution in TC would be desirable...
Maybe some food for thought for the author of Total Commander?
I will try to make a version of this script which writes a file
which then can be loaded with LOADLIST from a button.
To my knowledge this last step can't be avoided.
But the handling would then be very simple
1. Hotkey from the Everything screen writes the file
2. Hotkey or button from TC invokes the Loadlist command
NotNull
Posts: 5252
Joined: Wed May 24, 2017 9:22 pm

Re: Send ResultsList to Total Commander

Post by NotNull »

horst.epp wrote: Fri Oct 08, 2021 10:06 am The following AHK script (from Notnull if I remember)
Not this time :)



Offtopic anectdote:
A long time ago some company hired me back to do "some stuff".
When I got there and looked at what they already had done, I said to the guy next to me that the part that was already there, was done really clever.
He looked at me in silence for a couple of seconds and finally said: "But *you* did that!

That was rather embarrassing ...

TLDR: I usually do something and then forget about it, so maybe I wrote that script after all .. ;)
horst.epp
Posts: 1344
Joined: Fri Apr 04, 2014 3:24 pm

Re: Send ResultsList to Total Commander

Post by horst.epp »

Unfortunately there is a bug in TCs LOADLIST command
So currently it doesn't handle folder names correctly
and requires a \ at the end of such an entry.
horst.epp
Posts: 1344
Joined: Fri Apr 04, 2014 3:24 pm

Re: Send ResultsList to Total Commander

Post by horst.epp »

With the help of user Highend in the XYplorer forum
we now have a script and procedure to load Everything GUI results into TC.
All you need is pressing one hotkey while in the Everything GUI.
The rest is automatic :D
Here the link to my description in the TC forum
https://www.ghisler.ch/board/viewtopic. ... 27#p406127
verviers
Posts: 34
Joined: Tue Nov 01, 2022 7:48 am

Re: Send ResultsList to Total Commander

Post by verviers »

Is it possible to get such a function natively in Everything, without external scripts (smth goes wrong and it doesn`t work for me)? Is it worth to create feature request?
horst.epp
Posts: 1344
Joined: Fri Apr 04, 2014 3:24 pm

Re: Send ResultsList to Total Commander

Post by horst.epp »

verviers wrote: Sun Dec 04, 2022 9:38 am Is it possible to get such a function natively in Everything, without external scripts (smth goes wrong and it doesn`t work for me)? Is it worth to create feature request?
What do you mean with this ?
You can allready export Everything results into a file without any script.
Why should Everything have a function which loads the list in external file managers.
We use our AHK script for example in Total Commander, XYplorer and Free Commander.
Other made similar scripts for Dopus.
Should Everything realy know the details of all such tools ?

Btw. what doesn't work for you with the AHK script ?
verviers
Posts: 34
Joined: Tue Nov 01, 2022 7:48 am

Re: Send ResultsList to Total Commander

Post by verviers »

horst.epp wrote: Sun Dec 04, 2022 10:01 am What do you mean with this ?
I mean, that there are options for TC in Everything to open items from context menu (Open Folders, Open Path etc). So may it be possible to implement "Load list" feature in similar manner? Sorry for newbie questions.
Btw. what doesn't work for you with the AHK script ?
Did not investigate meticulously, but it failed to load list. Empty tab was appearing.
horst.epp
Posts: 1344
Joined: Fri Apr 04, 2014 3:24 pm

Re: Send ResultsList to Total Commander

Post by horst.epp »

verviers wrote: Sun Dec 04, 2022 10:44 am
Btw. what doesn't work for you with the AHK script ?
Did not investigate meticulously, but it failed to load list. Empty tab was appearing.
Follow the the description in
https://www.ghisler.ch/board/viewtopic.php?t=75439
Many users did it and it works.
If you have specific questions feel free to ask here
or in the TC forum thread.
Post Reply