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
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 »

v1.2 @ https://github.com/hi5/F4MiniMenu

a) Updated class name for Find Results control class (TMyListBox2, 32bit) for TC11
b) Added: Help MsgBox-es in Settings Gui now Task Modal (32+8192=8224)
c) Added: Settings label to Gui to better handle closing the Gui https://github.com/hi5/F4MiniMenu/issues/24#issuecomment-1573127847
d) Added: GuiEscape for Add/Modify editors dialog to allow Esc to exit (next to Alt+c) https://github.com/hi5/F4MiniMenu/issues/24#issuecomment-1573127847
e) Fix: no longer require full path for programs in PATH e.g. `write.exe` v `c:\windows\write.exe`, bug introduced in v1.1 due to GetFullPathName() https://github.com/hi5/F4MiniMenu/issues/24#issuecomment-1573127847
f) Fix: use SplitPath for `%p` parameter when not using TC https://github.com/hi5/F4MiniMenu/issues/24#issuecomment-1573127847
g) Change: `%p` and `%t` now use wm_copydata
h) New: `%N` and `%M` to place filename under the cursor into the command line (source and target directory) using wm_copydata
i) New: Added support for `%$DATE%`, `%$DATE:YMD%` + offset calculations via `%$DATE:YMD|value|timeunits%`
j) Fix: F4TCIE quote file path for `%file%` to resolve paths\files with spaces
k) Fix: F4TCIE `Run notepad` changed to `Run %A_WinDir%\notepad.exe` to avoid any potential path issues. Added ExitApp after Run command
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: 1249
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
you only need to set it up if you want to edit files in archives (zip files); and not for regular files in normal panels
I have a strange misunderstanding of this sentence as a whole.
When working with Total, we always press F4 just by selecting the file we need.
And of course, we don't determine in any way that this file is in the archive, or it's a "regular file on a normal panel".
Because we know that the Total ITSELF can make some internal definitions it needs, IF it's important TO allow this command
to execute correctly: the edit of the file at some specific place.

And here you are now writing that we ourselves are SOMEHOW! should separate situations - when we press F4 on the file IN ARCHIVE,
and when we press the SAME F4 - but now in the regular, normal file panel. Is it even possible to do that?
In the Total, there is only one place for editing the called editor, and there are no special settings - saying that with such-and-such
situation, we WILL call this editor - but with such-and-such - we will NOT.
Last edited by AntonyD on 2023-10-31, 08:47 UTC, edited 1 time in total.
#146217 personal license
KozakMak
Senior Member
Senior Member
Posts: 370
Joined: 2021-05-24, 12:39 UTC
Location: UA

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

Post by *KozakMak »

if one result = show menu

...but instead it - opened notepad directly
OS: Win10 | TC: latest x64
KozakMak
Senior Member
Senior Member
Posts: 370
Joined: 2021-05-24, 12:39 UTC
Location: UA

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

Post by *KozakMak »

2hi5
can you add ability to send images to images.google.com ?
OS: Win10 | TC: latest x64
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 »

KozakMak wrote: 2023-10-31, 08:30 UTCif one result = show menu ...but instead it - opened notepad directly
Just to be sure: that option is for the Filtered menu only and you need to define a hotkey to use it (to show the filtered menu, the full menu does have a default hotkey Esc+F4)

It works here as I intend it, so I suspect that you haven't set up an editor for that extension so it just opens it with notepad as it can't find an program to use.
To test and assuming you haven't already assigned an editor for BMP files:

Select a BMP file in Total Commander, press Esc+F4 to bring up the foreground menu, Add new editor.
Now the editor screen should appear and the BMP already added to the extension. Enter mspaint.exe
in the "exe" field and click OK to close (save) - no need to change parameters etc.

So now when you are on the BMP file and press the show filtered hotkey you have set up (see above).
You should see your default editor (lets say notepad) AND MS Paint as the only two programs followed by "z. full menu" options.
KozakMak wrote: 2023-10-31, 09:57 UTC2hi5 can you add ability to send images to images.google.com ?
I think that is out of the scope of F4MM, however if you can find a program or script that will send the image to Google you can use F4MM to send it to that program. So it would have to be a standalone program.
A script I could envision:
1. open image in browser
2. activate browser window
3. right click in the center of the browser window (which is where the image will be)
4. choose the "send to Google Images" or "Google Lens"
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 »

Re editing files in Archives: that's just the way it is..

It is simply not possible to open multiple files directly from an archive. Only one is allowed and only the file under the caret, not selected files.
Internally TC unpacks the file to the temp folder, and waits until the user tells it it is done to repack it (if the user wants it).
There is simply no way to
a) extract all files
b) process these these files to edit them all, and finally
c) instruct TC to copy these back to the archive.

I'm simply using this list http://en.wikipedia.org/wiki/List_of_archive_formats to check if we're in an archive, if so, send an internal TC command to "edit" a file. That lets TC know it needs to unpack the file to the temp folder, and then F4MM tells TC to EDIT using the defined editor in the TC settings.
As we know that can only be one editor. So I made F4TCIE to be able to read the defined editors from the F4MM settings in 2017. Before that it simply used the "TC editor" which just happens to be my default editor in F4MM anyway. I see no other way to do it.

I have no proof but I suspect that most editing in archives/FTP will be text files which will be edited by the preferred editor anyway so there is little need for it (for F4TCIE that is) I suspect and I doubt anyone actually notices it.

F4MM "overrules" the TC editor in all other cases in a default F4MM setup as it blocks the F4 key from being received by TC.

And everyone is free not to use F4MM and/or F4TCIE of course. If you find another solution to better suit your needs just use that.
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
dmocha
Junior Member
Junior Member
Posts: 52
Joined: 2013-05-05, 19:09 UTC
Location: Poland

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

Post by *dmocha »

Hi
Perhaps this question has already been asked, I didn't notice it in the thread.
Is it possible to translate F4MenuMini?
If so, in what way?
regards
dmocha
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 »

dmocha wrote: 2023-11-05, 11:58 UTCIs it possible to translate F4MenuMini?
It can be translated but as the Gui only has a few buttons and very short texts I think it is hardly worth translating.
The https://github.com/hi5/F4MiniMenu/blob/master/readme.md would make more sense but Google (or other) automatic translate does a decent job I expect.

Gui + MsgBox commands in the source code have texts in the following files:

Code: Select all

F4MiniMenu.ahk 
F4TCIE.ahk
inc\Settings.ahk
inc\Editors.ahk
inc\Find.ahk
inc\TotalCommanderPath.ahk
Most texts are visible in the screenshots https://github.com/hi5/F4MiniMenu#screenshots
Edit: for future proof updates all these texts should become variables which would have to be stored in a language file which is part of the reason I'm not that interested.
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 »

v1.3 @ https://github.com/hi5/F4MiniMenu :arrow: Fix: %N and %M now processed correctly :oops:
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 »

v1.4 @ https://github.com/hi5/F4MiniMenu
  • New: enable/disable F4MM for Lister and Find Files (search results) windows (see settings). If Lister setting is active and F4Edit>1 in wincmd.ini: close Lister
    In TC 11.03 the press "F4 to open currently viewed file in Lister" was added.
    (See F4Edit= options in TC help file on how to handle F4 in Lister via wincmd.ini. F4TCIE _could_ be used.)
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 »

v1.41 @ https://github.com/hi5/F4MiniMenu
  • Fix for reading F4Edit= setting in case F4MM was started before TC (to be able to access environment variable)
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 »

hi5 wrote: 2024-01-27, 08:24 UTC
  • Fix for reading F4Edit= setting in case F4MM was started before TC (to be able to access environment variable)
Still requires further work as it is hard(er) to obtain the new temp. environment variables which are created _after_ the script has launched. Reloading the script while TC is active should always resolve it for the time being.
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
petermad
Power Member
Power Member
Posts: 14809
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

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

Post by *petermad »

Moderator message from: petermad » 2024-01-29, 20:08 UTC

Moved 15 posts to "TC suggestions (English)" -> "F4 from Lister to Editor" by request from hi5
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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
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 »

For those using F4MM and a wish to create text files with specific encodings for Shift+F4 a reminder F4MM has had DocumentTemplates for a while so you can define any type of file (text, word processing, spreadsheets, images) for your preferred program(s) -- examples and docs here https://github.com/hi5/F4MiniMenu/tree/master/DocumentTemplates

For reference, the cm_edit command also has a Templates option /T, see the Help file:
cm_edit help wrote:T: Instead of creating an empty file, copy a template file to the new name. By default, the user's template directory will be used.
The first file in it with the same extension will be copied to the new file. If no file is found, an empty file will be created
T="c:\path": Sames as T but use the specified template directory
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 »

v1.42 @ https://github.com/hi5/F4MiniMenu - further improvement for reading wincmd.ini / F4Edit setting

To be able to read the F4Edit setting from wincmd.ini F4MM now uses the following:

1. Check settings for INI path to wincmd.ini (added to settings menu);
2. Try to get the Environment variable;
3. Try the registry using (see below)

QuickView will remain experimental, see settings. I think I found a reasonably reliable method to detect when QuickView is being used:
Settings:
[x] when checked, it will try to open the file that is currently open in the QuickView panel, even if multiple files are selected in the active TC panel and the focus is NOT on the QuickView panel it self. The foreground and filtered menus can be opened in the QuickView panel, but here also only the one "viewed" file will be opened.
[ ] when unchecked all selected files will be opened even when QuickView is being used.

Registry -- source: https://ghisler.ch/board/viewtopic.php?t=258
Search in this order, the 1st key that exist should be used:
1. HKCU\Software\Ghisler\Total Commander
2. HKLM\Software\Ghisler\Total Commander
3. HKCU\Software\Ghisler\Windows Commander
4. HKLM\Software\Ghisler\Windows Commander
Under each key there should be three values:
1. "InstallDir" - Path where TC/WC is installed
2. "IniFileName" - Relative* path to the "WinCmd.ini"
3. "FtpIniName" - Relative* path to the "wcx_ftp.ini"

IniFileName=%AppData%\Ghisler\wincmd.ini (Option "Application Data")
IniFileName=%UserProfile%\wincmd.ini (Option "Documents and Settings")
under older systems: Windows directory
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