Skip to content

Commit

Permalink
v1.3 fix for %n and %m
Browse files Browse the repository at this point in the history
  • Loading branch information
hi5 committed Nov 22, 2023
1 parent be1fae6 commit b8f6992
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 13 deletions.
13 changes: 7 additions & 6 deletions F4MiniMenu.ahk
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
/*
Script : F4MiniMenu.ahk for Total Commander - AutoHotkey 1.1+ (Ansi and Unicode)
Version : v1.2
Version : v1.3
Author : hi5
Last update : 02 April 2023
Last update : 21 November 2023
Purpose : Minimalistic clone of the F4 Menu program for Total Commander (open selected files in editor(s))
Source : https://github.com/hi5/F4MiniMenu
Note : ; % used to resolve syntax highlighting feature bug of N++
*/

#Requires AutoHotkey v1.1.31+
#SingleInstance, Force
#UseHook
#NoEnv
Expand All @@ -19,10 +20,10 @@ SetWorkingDir, %A_ScriptDir%
SetTitleMatchMode, 2
; Setup variables, menu, hotkeys etc

F4Version:="v1.2"
F4Version:="v1.3"

; <for compiled scripts>
;@Ahk2Exe-SetFileVersion 1.2
;@Ahk2Exe-SetFileVersion 1.3
;@Ahk2Exe-SetDescription F4MiniMenu: Open files from TC
;@Ahk2Exe-SetCopyright MIT License - (c) https://github.com/hi5
; </for compiled scripts>
Expand Down Expand Up @@ -641,9 +642,9 @@ GetInput(byref parameters, byref file, byref startdir, byref execute, program)
if InStr(parameters,"%o")
parameters:=StrReplace(parameters,"%o",GetTCFields("%o",file))
if InStr(parameters,"%n")
parameters:=StrReplace(parameters,"%o",GetTCFields("%n",file))
parameters:=StrReplace(parameters,"%n",GetTCFields("%n",file))
if InStr(parameters,"%m")
parameters:=StrReplace(parameters,"%o",GetTCFields("%m",file))
parameters:=StrReplace(parameters,"%m",GetTCFields("%m",file))
if InStr(parameters,"%$date")
{
DateTimeObject:=GetTCFields(parameters)
Expand Down
3 changes: 2 additions & 1 deletion F4TCIE.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ Templates : Create a DocumentTemplates\ folder and place files for each templa
*/

#Requires AutoHotkey v1.1.31+
#NoTrayIcon
#NoEnv

; <for compiled scripts>
;@Ahk2Exe-SetDescription F4MiniMenu (IE): Open files from TC
;@Ahk2Exe-SetFileVersion 1.2
;@Ahk2Exe-SetFileVersion 1.3
;@Ahk2Exe-SetCopyright MIT License - (c) https://github.com/hi5
; </for compiled scripts>

Expand Down
6 changes: 5 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
## Changelog

* 20231121 - v1.2
* 20231121 - v1.3
a) Fix: `%N` and `%M` now processed correctly
b) Added "#Requires AutoHotkey v1.1.31+" directive for users with v1 & v2 installed, added note in documention about using v1 AutoHotkey.exe in setup

* 20231030 - v1.2
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
Expand Down
27 changes: 22 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# F4MiniMenu - v1.2
# F4MiniMenu - v1.3

A <kbd>F4</kbd> Menu program for [Total Commander](http://www.ghisler.com/) to open selected file(s) in editor(s).
(and experimental/rudimentary support for Windows Explorer, Double Commander, XYPlorer, and Everything - only [when activated](#other-programs)).
Expand All @@ -13,7 +13,7 @@ It is a *standalone* program which runs separatly from Total Commander. See Gett
b. Matching Editors based on extension (filtered menu)
* Various methods to open selected files: "[regular](#normal)", "[Drag & Drop](#drag-drop)", [Filelist](#filelist), [cmdline](#cmdline)
* Document Templates to create new files for file types other than "text" - [DocumentTemplates README](DocumentTemplates/readme.md)
* Open source - written in [AutoHotkey](https://www.autohotkey.com/)
* Open source - written in [AutoHotkey](https://www.autohotkey.com/) (v1.1)

## Discussion

Expand Down Expand Up @@ -104,13 +104,13 @@ Once F4MiniMenu is started, the Global settings and new editors with a variety o
* Menu
- Position of Menu
- Accelerator key for full menu when using the filtered menu
- Show menu or Edit file directly when using the filtered menu
- Show Menu or Edit file directly when using the filtered menu
* Files (Maximum number of files to be opened, will ask for confirmation if more are selected)
* WinWait -- see below
* Total Commander
- TC Start
- TC Start (Start Total Commander when F4MM is started, or not)
- TC Path
- Close F4MM options
- Close F4MM options (Exit F4MM when Total Commander closes)
* Hotkeys
- Background
- Foreground menu
Expand Down Expand Up @@ -331,6 +331,23 @@ To configure Total Commander to use F4TCIE.ahk:
TC, Configuration, Edit/View, Editor (ini):
drive:\path-to\F4TCIEi.ahk "%1"

Note: if both AutoHotkey v1.1 and v2 are installed you may receive an error message (from the AutoHotkey launcher).
In that case include the full path of the AutoHotkey v1.1 executable before the drive:\path-to\F4TCIE.ahk like so:

TC, Configuration, Edit/View, Editor:
c:\program files\autohotkey\autohotkey.exe drive:\path-to\F4TCIE.ahk "%1"

Tip: To use %PROCESSOR_ARCHITECTURE%

Rename

F4TCIE-64i.exe -> F4TCIE-amd64i.exe
F4TCIE-32i.exe -> F4TCIE-x86i.exe

then use

drive:\path-to\F4TCIE-%PROCESSOR_ARCHITECTURE%.exe "%1"

If for some reason the configuration can not be opened, an attempt is made to start the editor
for the file type associated in Windows (so for txt -> notepad, for bmp,jpg -> MS Paint etc).
When there is no editor for the file type found `notepad.exe` is started.
Expand Down

0 comments on commit b8f6992

Please sign in to comment.