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: white, Hacker, petermad, Stefan2

Post Reply
User avatar
AntonyD
Power Member
Power Member
Posts: 1231
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 »

2hi5
Concerning problem with 2 and after attempts to call F4 on files.
After first try to open some file with corresponding editor by F4 - and all other attempts will fail.
F4 does nothing from this moment. Completely nothing...
The same and for shortcut, used for filtered menu (ESC+F4).
First attempt does work - the second and all others doesn't.
In this moment I even cannot open settings window:
https://ibb.co/bNrrt2R
I get this error.
Keeping a list of PIDs and waiting for new ones, or new "windows" is not something I'm going to do as it won't be needed for 99.999% of the programs out there (I never encountered it for example).
that is, you do not solve once and for all the situation with possible problems with the processing of not those or not all windows of the opened editors, just because you did not have such a situation?

And "could we have a special (logged) program, which will write all actions??? So you can compare your variants and my variants of execution the same actions."

Concerning
"Language:
The Gui only has a few buttons which are hardly worth translating"
I highly doubt it. IF a user wants to use some very useful utility - the first thing to be searched is the presence of their own interface language!
At least in our country.))))
Does not matter- how many GUI elements are here. So - IF the AHK script in it's essence support internationalization of GUI elements...
Let's do it! Let's translate ALL!

"Meny by Ext:
I don't think I'll do this it would mean more actions to open the desired program because you need to expand the _ext_ menu to get to the editor you want."
But the whole point is precisely in the search for the editor consciously and logically and not by icon and by name.
If I made the opening of CPP files in three different editors, for example, then there is no benefit from that these editors
will simply be listed one by one. More important and useful when choosing is only the moment that FOR the CPP extension
there ARE options for opening with editors X, Y, Z ...
#146217 personal license
hi5
Power Member
Power Member
Posts: 551
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 »

AntonyD wrote: 2022-11-06, 18:07 UTC https://ibb.co/bNrrt2R
I get this error.
My guess is that F4MM isn't running (or doesn't use the F4 shortcut) and it falls back to F4TCIE. The error message means you probably haven't renamed
F4TCIE-64.exe to F4TCIE-64i.exe so it tries to read the XML settings (which don't exist). I could probably add a fallback check to see if it can load the INI if the XML settings can't be read.

The XML in the error message indicates you tried to open an XML file and has nothing to do with the settings.xml as such, you would see "PNG" if you tried to open an PNG file I think.

Edit: I tried it, and it won't work how I would expect or want it to so the "try to read ini if not renamed to *i.exe" won't be added. I'll add a note to the error message window it may have to be renamed.
Last edited by hi5 on 2022-11-06, 19:02 UTC, edited 1 time in total.
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: 551
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 »

After first try to open some file with corresponding editor by F4 - and all other attempts will fail.
That probably means it is stuck and "waiting" for a program to start (which probably already started or failed to start). Does it happen for all programs (say notepad) or just a specific program.
Adding logging would be a lot of work.
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: 1231
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 »

My guess is that F4MM isn't running (or doesn't use the F4 shortcut) and it falls back to F4TCIE. The error message means you probably haven't renamed
F4TCIE-64.exe to F4TCIE-64i.exe so it tries to read the XML settings (which don't exist). I could probably add a fallback check to see if it can load the INI if the XML settings can't be read.
No, program F4MM itself was alive. F4 was assigned properly. Rename WAS done correctly and INI file does exist on a disk.
That probably means it is stuck and "waiting" for a program to start (which probably already started or failed to start). Does it happen for all programs (say notepad) or just a specific program.
Adding logging would be a lot of work.
NO, I had 2 cases. 1) Editor was ALREADY opened and ready for catching new files ASAP. Tested the same case with 1.0 ver. and all is works as expected.
2) Editor was not opened earlier - so I expect to see at the process monitor (process hacker - 2nd tool) the moment of "raising exe" ;)
And I did not see it. Does not matter how many times I've clicked|pressed F4 - nothing happened inside the processes tree... Tried to make the same with 1.0 ver. and all is works as expected.
"Does it happen for all programs" - yes.

"would be a lot of work" - This is true - but you do it once and for all! Then, if someone has problems that cannot be solved by simply analyzing the description of the problem itself, then it will be enough to tell the problem user: "hey! Just simply restart the main F4MM exe with the --start-logging key and after repeating the problem, send me the F4MM.log file by mail or PM/forum. I'll read - I'll figure out what happened && what is not right!"

The same goes for internationalizing a project. Having prepared the structure of input files describing translations, you do it once and for all. Then only people send you these JSON|XML-based files with translation, and the program just loads and uses the lines from there.
Last edited by AntonyD on 2022-11-07, 20:07 UTC, edited 1 time in total.
#146217 personal license
User avatar
AntonyD
Power Member
Power Member
Posts: 1231
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 »

2hi5
Found lifehack how to back to alive by F4 your 1.1 utility. temporarily...
Relaunch script. This is works for next 1 attempt to open file(-s) at once.
And this, as you understand - I called the main exe utility from the main menu. Those. the process never disappeared.
IT has always been and IS in windows memory, but now it looks like it can now perform his job of ?intercepting clicks?
only once, then it needs to be restarted.
#146217 personal license
hi5
Power Member
Power Member
Posts: 551
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 »

Reloading always helps :)

I strongly suspect you're using the cmdline option, just use normal. Many (normal :)) window programs don't respond the way you might expect to
program.exe "path to file\file1.txt" "path to file\file2.txt" "Etc"

Normal for nearly all programs, if it opens an instance for each file you open, drag&drop is something you can try although it will be hit and miss as not all programs accept the method used by AutoHotkey. Filelist is for programs that a text file which contains a list of files (like a mp3 playlist for winamp or (UltraEdit /f option).

I think I may have found a fall back method to see "a second instance" but that will take a little while for me to add (and test)
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: 1231
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 strongly suspect you're using the cmdline option, just use normal. Many (normal ) window programs don't respond the way you might expect to
program.exe "path to file\file1.txt" "path to file\file2.txt" "Etc"
My case is exactly the opposite. This is the type of file transfer support for editors that I was originally looking for. It is in the form:
main.exe file1.ext file2.ext file3.ext - I have those editors that I want to assign support to in this utility.
The normal way of calling it caused a lot of runtime errors and incorrect file openings, which I wanted to get rid of.
#146217 personal license
hi5
Power Member
Power Member
Posts: 551
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 »

Updated v1.1 @ https://github.com/hi5/F4MiniMenu/releases/tag/v1.1 (added g&h)

This should prevent the program stalling/waiting (MaxWinWaitSec seting) and be able to detect a second instance of a program.

a) Fix: try to catch all empty hotkeys to avoid errors at startup
b) Change: double click on an "editors" opens modify window
c) Change: Settings - replace Radio controls for Esc/Win with DropDownLists (not thoroughly tested)
d) Fix: WinMin/Hide/Maximize and Sleep function should work better (again)
e) Fix: additional check to prevent Modify Gui throwing "The same variable cannot be used for more than one control" error
f) New: TRY, catch -> revert to standard editor if defined editor can not be found, show notification using OSDTIP_Pop() for both F4MiniMenu and F4TCIE
g) New: Global setting MaxWinWaitSec to prevent stalling F4MM
h) New: Use File name for WinMatch setting per editor

MaxWinWaitSec: (g)
Set the maximum time in seconds to wait for the selected program window to appear before applying the selected Window Mode (Normal, Maximized, Minimized -- see Editor configuration). This should also prevent any unexpected "waiting" in case a program launch failed (crash, very slow program start etc).
It may not be possible to edit (open) a new document during this defined waiting period.

Use File name for WinMatch: (h)
if a new instance of a program is launched AND the program shows the file name in the program (window) title bar, use this to be used to identify the new window and perform the defined Window Mode.
Note: This option is not available for the cmdline method WHEN multiple files opened at once. Results may vary.

I've tried various programs that do support cmdline such as VSCodium, but also those that don't and simply open the first file only.

Test case: XmlNotepad in normal mode, open multiple files, maximize window, all windows maximized when "Use File name for WinMatch" setting ticked in the editor settings.
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: 1231
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 »

2hi5
I would like to write right away about an unpleasant bug of interface window processing in the utility itself.
If you open the Configure Editors window, open the Modification window of a particular editor,
and then somehow accidentally move this window into the background (which, by the way, should be impossible in principle!), then
different errors of closing dialog/reloading the script occur...
#146217 personal license
User avatar
AntonyD
Power Member
Power Member
Posts: 1231
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 »

Test case: XmlNotepad in normal mode, open multiple files, maximize window, all windows maximized when "Use File name for WinMatch" setting ticked in the editor settings.
Not confirm. With mentioned ticked setting I get XMLNotepad window in NORRMAL size. Not min|not max - no matter as I tried to do so...

Setting up waiting seconds also does not bring anything useful or working in the scenario that is available from the previous 1.0 version....
IMHO without logs of action, we will not be able to improve anything. You need to understand - WHAT exactly happens to me, what is called, how, with what order, with what flags.... etc.

And yes, I repeat - I need a call script through the command line in the overwhelming number of editors and reviewers used. This is the only really convenient option for calling third-party programs. At least it should be like this))))
#146217 personal license
hi5
Power Member
Power Member
Posts: 551
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 »

The global MaxWinWaitSec is just there to prevent F4MM waiting for ever for a window to appear - which could happen until now, so now the foreground/filtered menu should always be accessible and other files edited even if something "went wrong"

I open 6 xml files with this XmlNotepad setup and it opens all 6 and maximizes them one by one. Using cmdline ONLY with one file it works (as described above)

Code: Select all

[3]
Delay=0
Exe=c:\portable\XmlNotepad\XmlNotepad.exe
Ext=xml
Method=Normal
Open=
Windowmode=2
StartDir=
Parameters=
Icon=
Name=
FileTitle=1
When multiple files are selected the Maximize step is ignored (I don't think XmlNotepad accepts multiple files via cmdline as it opens only one). As behaviour is unpredictable which "file" will be visible (in the title bar) the first, the last, one by one - when loading via cmdline the options to max/min is disabled. If it sees there is only one file it should work. (and does for XmlNotepad.exe).

I suggest you try some of the other F4 alternatives as they may work better or write a batch file to do what you want/need using the %S and/or %L option of TC passing on the file names to the batch file and you can then use a utility like https://www.nirsoft.net/utils/nircmd2.html#using to min/max/move windows as you need them to - that way you don't need a F4 utility but created your own.
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: 1231
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 »

Suggestion - since it is possible to call Settings from the the editors configurator, let it be possible to do the "opposite" - from the settings to call the the editors configurator!

P.S. and regarding the maximize windows option - it's important, but not so important that you try to solve it only.
For example, I found a VBSEdit editor which seems to be unable to open its window at MAX at all.
This program just stops responding after that.

Also, I still don't understand how Drag&Drop mode works. Completely don't understand.
It seemed to me that this should just be an emulation of such an argument passing to the editor!
i.e. I'm still in Total Commander just selecting files, clicking F4 and getting an open editor
with previously selected files selected in TC. Just a way to pass them to this editor is the "Drag&Drop" way.
But this feature just has to be a purely internal technical part of the utility code programming to support
the transfer of a list of files to a specified editor. But looks like this is not working as is...
Last edited by AntonyD on 2022-11-19, 10:25 UTC, edited 1 time in total.
#146217 personal license
User avatar
AntonyD
Power Member
Power Member
Posts: 1231
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 »

MaxWinWaitSec: (g)
Set the maximum time in seconds to wait for the selected program window to appear before applying the selected Window Mode (Normal, Maximized, Minimized -- see Editor configuration). This should also prevent any unexpected "waiting" in case a program launch failed (crash, very slow program start etc).
By the way, in theory, what was written seems to be perceived as follows: that there is a certain period of time during which it is expected that a window ХХХ will appear, which we needed. BUT in any millisecond of this waiting period, it is checked whether this window is there or not. In other words, if for example, you set the period to 5 seconds, and after 1 second the expected window appeared - then the timer does not continue to tick, ending these 5 seconds. That's what was expected and kind of read "between the lines".
And practice seems to show that this period of time is certainly expected. And it does not matter that already in 1 second of this waiting, the desired window is already on the screen. The timer still waits for a given amount of time for some reason. Why such a waste of resources?
#146217 personal license
User avatar
AntonyD
Power Member
Power Member
Posts: 1231
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 »

[img]https://i.ibb.co/tCyWVWb/2022-11-17-201712.png[/img]
At the same time, the program (F4MiniMenu-64i.exe) was launched. The file has been renamed (F4MiniMenu-64i.exe) to support working with the INI file to store the configuration. The INI file itself (F4MiniMenu.ini) was and is on disk and is available for reading and editing. BUT the utility stubbornly shows this dialog.
WHAT is it looking for at this moment and WHAT does it need to check? What is the condition for displaying this dialog?
Last edited by AntonyD on 2022-11-19, 10:24 UTC, edited 1 time in total.
#146217 personal license
hi5
Power Member
Power Member
Posts: 551
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 »

Just like F4MiniMenu-64i.exe, F4TCIE-64.exe also has to be renamed to end with an i, the error message says it can't open the XML file indicating the 'i' isn't there.
https://github.com/hi5/F4MiniMenu#helper-script-f4tcieahk- wrote:.... If you are using the INI format to store your settings be sure to rename the script to end with an "i" (see 'XML or INI' above)
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)
Post Reply