F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

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

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
AntonyD
Power Member
Power Member
Posts: 1554
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

Post by *AntonyD »

F4MM expects the default editor to have at least one extension assigned to it
And if you add the logic that if: NO extension is set for the first editor/default editor, then look at
all other strings/editors first - for matching extensions, and then at the END of the comparison,
if no match is found, ONLY then call this default editor?
It makes a lot more sense to me. Otherwise I'll have to set a non-existent extension for the first editor,
simply because I don't want to tie it to any real need.
#146217 personal license
hi5
Power Member
Power Member
Posts: 637
Joined: 2012-11-03, 11:35 UTC
Contact:

Re: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

Post by *hi5 »

But does it now open your xml file in your xml program instead of akelpad when you assign txt to it? If so I'll make txt mandatory for the default editor if none is defined.
F4MiniMenu (Forum) - Open selected file(s) from TC in defined editor(s) - A (minimalistic) clone of F4Menu
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)
hi5
Power Member
Power Member
Posts: 637
Joined: 2012-11-03, 11:35 UTC
Contact:

Re: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

Post by *hi5 »

v1.45 @ https://github.com/hi5/F4MiniMenu
Finetuning Everything_Active() detection + Use TXT as default ext for default editor if user doesn't set one - otherwise it would not match correctly for define extensions
F4MiniMenu (Forum) - Open selected file(s) from TC in defined editor(s) - A (minimalistic) clone of F4Menu
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)
User avatar
AntonyD
Power Member
Power Member
Posts: 1554
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

Post by *AntonyD »

But does it now open your xml file in your xml program instead of akelpad when you assign txt to it?
yes.

will test now 1.45....

P.S.
So.....
Good news - That’s the situation that was - it passed: with inability to correctly use ENTER key and facing with
Total window that flies to the foreground all the time - this bug has gone... That's a really good news.

Bad news: With 'Everything' tool all is bad. And this bad thing is a "new" bad thing. In a prev. test it was not so!
Now after the selection of a 3 files - EXACTLY as in your screenshot - and pressing F4 I get the next case:
Global Selection is lost. LAST file which was used in this selection - get selected and get input focus.
F4 again - and SELECTION + focus is moving on a first row - the first of only six lines to be displayed after
filtering. As in your screenshot.
F4 again - and SELECTION + focus is moving on a second row.
F4 - third row ... and so on as you can understand...
In other words, the F4 key now works like a "down arrow" key.

After Suspending Hotkeys - behavior of F4 inside the Everything tool returned back to it's normal case...
#146217 personal license
hi5
Power Member
Power Member
Posts: 637
Joined: 2012-11-03, 11:35 UTC
Contact:

Re: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

Post by *hi5 »

v1.46 @ https://github.com/hi5/F4MiniMenu - finetuning selection of selected rows in Everything alpha listview (note to self: don't bother with alpha software in the future)
F4MiniMenu (Forum) - Open selected file(s) from TC in defined editor(s) - A (minimalistic) clone of F4Menu
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)
User avatar
AntonyD
Power Member
Power Member
Posts: 1554
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

Post by *AntonyD »

I'll answer right away about the alpha version. Believe me - this product is just called alpha by the developer for some obscure coincidence,
but in fact it's already at least RC4 if we make the analogy with TC))). I.e. it's just a microstep away from the final build.
And if you don't have any problems with Total and install its RC, then this product - even if it has alpha in its name - is worth installing
and using in normal mode and not considering it as "unfinished". and it's not a release-labeled and only.

1.46. Now inside Everything pressing of F4 does nothing at all: not a bad so and not a good news obviously(((
Also tried for Explorer - also F4 does nothing. But "Filtered mode (menu)" does work - I can see and choose proper items.
BUT! editor will not be called unfortunately((( Probably have very strange "something" in my OS (((.
Maybe some logs we can activate? So at least we can be sure that the keystrokes were caught by your tool - and cmdlines were prepared...

After all, the fact that even a direct editor selection in the menu, which could still be seen - suggests strange thoughts regarding - and WHAT kind of command lines are formed at this point? After all, if I repeat it just in Window Terminal window - I won't get any problems with editor calls on many files.
#146217 personal license
User avatar
AntonyD
Power Member
Power Member
Posts: 1554
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

Post by *AntonyD »

btw in the Readme.md We can find next phrase:

* See [changelog.md](changelog.md)

but there is no such file at all.
#146217 personal license
hi5
Power Member
Power Member
Posts: 637
Joined: 2012-11-03, 11:35 UTC
Contact:

Re: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

Post by *hi5 »

Here is works everywhere (tc, dc, explorer, everything stable and α) so unless others reports that it no longer works I wouldn't know what to change (I haven't changed any code related to explorer for example) - let's see if more feedback emerges.
F4MiniMenu (Forum) - Open selected file(s) from TC in defined editor(s) - A (minimalistic) clone of F4Menu
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)
User avatar
AntonyD
Power Member
Power Member
Posts: 1554
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

Post by *AntonyD »

I agree to wait for more feedbacks - but logs?
Doesn't your utility have them in it? To be able to check WHAT is called and when and by what means?
Well, don't tell me that I have to download and run the *.ahk script directly - and through some development
environment like 'AHK Studio', to get answers to these same questions.....

And if you can offer only debugging by my own efforts, at least tell me on which line the code starts,
which is triggered by pressing F4?

P.S.
No, the process of debugging on my own is not very clear - at least some helper files in the solution/among sources
are missing, to basically build the final executable based on this main script...
#146217 personal license
User avatar
AntonyD
Power Member
Power Member
Posts: 1554
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

Post by *AntonyD »

Okay, I found a log calls in the initial script code:) Lucky me!
I enabled it and this is what happens - if I call in Total window F4 over any files that should be opened either by assigned editors
or by default editor - everything happens exactly like this and the corresponding entries appear in this log! So all is working here!

And if I will try to call F4 in the Everything program, or call the "Filtered mode (menu)" and in it click any of the necessary editors/
items corresponding to the extension of the selected files - then NOTHING is recorded in this log or happens visually (in TaskManager).

We can conclude that support of F4 interception in other programs works unreliably or does not work at all in my private conditions.
WAY more detailed log I think we need.
#146217 personal license
hi5
Power Member
Power Member
Posts: 637
Joined: 2012-11-03, 11:35 UTC
Contact:

Re: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

Post by *hi5 »

v1.47 @ https://github.com/hi5/F4MiniMenu - Configure Editors GUI can now be maximized; some code cleanup, your mileage may vary.
F4MiniMenu (Forum) - Open selected file(s) from TC in defined editor(s) - A (minimalistic) clone of F4Menu
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)
User avatar
AntonyD
Power Member
Power Member
Posts: 1554
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

Post by *AntonyD »

Now in a log I get this:

Code: Select all

20250210112111 : GetFiles, Everything ->

-----------------------
So from this we can understand the root cause of my problems....

P.S.
In principle, with other programs that are able to capture information from GUI elements of open windows,
I can definitely get the necessary fields. I.e. it's definitely not a problem protecting 'Everything' from such utilities.
But maybe it's a matter of - in what sequence and from which cells are you trying to get information?
For example, I have a "broken" order of columns, not the one that goes by default, and their number
and the essence of the selected columns is different.

IN a code you are using for searching the class name 'SysListView321' - which is reflect 'classNN' field.
But why not the simple 'class' filed/name? 'SysListView32'?
And yes as I see in a code:

Code: Select all

		 filepath:=StrSplit(A_LoopField,A_Tab)
		 result .= filepath[2] "\" filepath[1] "`n"
You are trying to use predefined, default order of a columns. So it will be "PATH" "\" "NAME" "`n"
But in a case of custom order - what it will be?

And looking at the code:

Code: Select all

WinGet, EverythingExe, ProcessName, Everything
I can assume that you are using v1 of AutoHotkey API, not the latest one: v2? why?

And again. I'm sorry if I misunderstood, but it seems that the last parameter is an optional WinTitle parameter.
And it seems that this is the text that is written in the title of the GUI main-window.
But if that's the case, then there's DEFINITELY not just a word "Everything" written there.
#146217 personal license
User avatar
AntonyD
Power Member
Power Member
Posts: 1554
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

Post by *AntonyD »

I've tried to dig in a little bit. And in a lib's script Everything.ahk I've changed slightly this part of code:

Code: Select all

	 WinGet, myList, List, Everything
	 WinGet, EverythingExe, ProcessName, WinTitle ahk_class EVERYTHING
Inside the very beginning of the function Everything_GetSelection()
And at the very top of the script I even added this line: SetTitleMatchMode, 2

And during debugging I could see inside the var 'myList' TWO! elements (but I still do not understand what are they?
Inside the 'M$ System Informer' I could not find anything related to these values)! So This should literally means that
I have 2 everything tools running on my machine???? )))
I thought a little more and realized! Of course! After all, my program is running as a service-an invisible exe-file!
And it's also running in GUI form! That is, yes, there are two programs now, but in theory only one of them actually has
a title. And that's why I wrote the second line as an addition: WinTitle ahk_class EVERYTHING
I thought this add-on would definitely help me/script to find the right window. But no.
There was a void in the variable output. Just as it was in the original unmodified code of your script.
That is, the code actually cannot find the program 'Everything64.exe' actually running in the foreground! FullStop....
#146217 personal license
User avatar
AntonyD
Power Member
Power Member
Posts: 1554
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

Post by *AntonyD »

Spoiler

Code: Select all

Everything_GetSelection(dir="0")
	{
		; Find the active window
		WinGet, activeWindow, ID, A
		if (!activeWindow) {
			MsgBox, No active window found!
			Return ""
		}

		; Check the window title
		WinGetTitle, winTitle, ahk_id %activeWindow%
		if (winTitle = "") {
			MsgBox, Cannot retrieve window title!
			Return ""
		}

		if !InStr(winTitle, "Everything 1") {
			MsgBox, The active window is NOT Everything!`nFound: %winTitle%
			Return ""
		}

		; First we try to take SysListView321 via ControlGetFocus
		ControlGetFocus, fileListCtrl, ahk_id %activeWindow%
		if (fileListCtrl != "SysListView321") {
			fileListCtrl := "SysListView321"  ; Forcibly trying this name
		}

		; Checking if the control exists
		ControlGet, check, Visible,, %fileListCtrl%, ahk_id %activeWindow%
		if (check = "0" or check = "") {
			MsgBox, No file list control (SysListView321) found in Everything!
			Return ""
		}

		; Get the selected files
		ControlGet, selectedFiles, List, Selected, %fileListCtrl%, ahk_id %activeWindow%
		if (selectedFiles = "") {
			MsgBox, No files selected!
			Return ""
		}
	 Loop, parse, selectedFiles, `n, `r
		{
		 filepath:=StrSplit(A_LoopField,A_Tab)
		 result .= filepath[2] "\" filepath[1] "`n"
		}
;	 If dir
;		Return % Trim(StrSplit(result,"`n").1,"`n") "\"
;	 else
	 	Return % Trim(result,"`n")
	}
Only after remaking the code for this, which is shown above - everything began to work for me.
Yes - I understand that code is very excessive there now - including an extra output through MSGBOX
But the main thing is that this concept works completely.

In the previous code, the code certainly did not work under any changes:
ControlGet, OutputVar, List, , SysListView321, ahk_exe %EverythingExe%

Perhaps there is/there was a limitation of the used V1 model of the script engine ...
Maybe it is still worth redrawing everything in V2? There is still further development there
And a fix of bugs. And the functionality of the same search is more advanced!
For example, this appeared: ControlGetClassnn - and now you can accurately verify when checking,
that control with the desired class exists in the window.

P.S.
Conversely, this "new"code lacks checking that the column sequence is correct.
Because if it is mixed by a user, the fact that in the code forcibly the second and
then the first columns are fetching and concat - it will not help to execute in overall
all code correctly. It's going to break.


P.P.S.
I found one strange piece of code:

Code: Select all

#If EscHotkeys and MatchList.settings.Everything and Everything_Active()
$Esc::
if (A_PriorHotkey <> "$Esc" or A_TimeSincePriorHotkey > 400)
	{
	 Keywait Esc
	 Return
	}
Else
	{
	 WinClose ahk_exe everything.exe
	 WinClose ahk_exe everything64.exe
	}
Return
#If
WHY we should forcibly to close the Everything process?
I wouldn't expect this behavior from a program that just got the ability to use a list of files
after filtering the search results in it -> to run them in corresponding editors...
#146217 personal license
User avatar
AntonyD
Power Member
Power Member
Posts: 1554
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

Post by *AntonyD »

But some things somehow always remain constant....

Do you remember from which problems we started our talk?
Strange behavior for a simplest *.h file at WinSDK folder?
So now I could catch in a log what is happening:

Code: Select all

20250211165417 : GetFiles, TC File Panel ->

-----------------------
As we can see from this path (not a TC panel! if I will open here simply another path - all will start working)
code of your tool is not able to get list of files....

P.S.
And I found a proof - that it's all to do with the number of files that are in the source folder.
Using the same Everything 1.5a utility, find a folder with a fairly large number of files in it:

Code: Select all

folder: childfilecount:>2100
And go to any of the ones you can find.
BUT! It is preferable, of course, that they are not folders inside C:Windows!
there could still be a permissions issue.... it's the M$(((((
And select any TXT file, and if it's not there, copy one there.
And you will magically be able to reproduce my problem.....
#146217 personal license
Post Reply