is that how it should work (in Configuration - Edit/View section)?"%commander_path%\Utils\Notepad++\notepad++.exe" "%S"
F4 - how to edit multiple selected files?
Moderators: Hacker, petermad, Stefan2, white
F4 - how to edit multiple selected files?
OS: Win10 | TC: latest x64
Re: F4 - edit multiple selected files?
No.
F4 always opens one file only.
There are other tools to extend F4 too, I will try to post them here too once I remember them all...
Also there a plugins like List2Multi and such, we already have collected them all, I just have to find the post again.
F4 always opens one file only.
Flint wrote: 2004-12-13, 13:13 UTC mds211
Try to use Choice Editor:
http://www.totalcmd.net/plugring/ChoiceEditor.html
It allows assigning different editors for different extensions for opening by F4, setting multiple editors for the same extension and opening all the selected files at once.
There are other tools to extend F4 too, I will try to post them here too once I remember them all...
Also there a plugins like List2Multi and such, we already have collected them all, I just have to find the post again.
Re: F4 - edit multiple selected files?
Alternative tools for the "F4-command" in Configuration:
It allows assigning different editors for different extensions for opening by F4,
setting multiple editors for the same extension
and opening all the selected files at once (multiple tabs in one editor or multiple editors, depends on used editor and settings on that editor)
- F4MiniMenu, http://ghisler.ch/board/viewtopic.php?t=35721
- ChoiceEditor, http://www.totalcmd.net/plugring/ChoiceEditor.html
- Open File shell for TC, http://www.totalcmd.net/plugring/OpenFileTC.html
- Total Commander Edit Redirector, http://ghisler.ch/board/viewtopic.php?t=27573
- F4Menu, http://ghisler.ch/board/viewtopic.php?t=17003
Re: F4 - edit multiple selected files?
a short list of related plugins:
List To MultiInstance aka L2M
http://totalcmd.net/plugring/listm.html
Copyright (c) 1999-2001 by Andrey V. Sorokin
l2m.exe /L:<List file> [/X:<Execute program>] [/B:<before param>] [/E:<end param>] [/W] [/S] [/P] [/F:<pause>] [/G:<gui mode>] [/R:<RegExp>] [/I] /J:<project>] [/M:<window_mode>] [/O:<priority>]
or
l2m.exe <filename>
List2Run\
http://ghisler.ch/board/viewtopic.php?t=3418
lst2run [-h] [-e [exe]] [-s [expression]] [-l [list.file]] [-w [ms.]][-p [ms.]] [-b]
lst2str\
http://www.ghisler.com/dtools.htm
lst2str /X:[program.exe] /L:[listfile] /F:[file] /N:[nnn] /W:[state] /C:[nnn] /S:[switches]
C:\wincmd\lst2str.exe /X:"C:\Program Files\ExamDiff Pro\ExamDiff.exe" /L:%L /F:%T%M /N:2
"%COMMANDER_PATH%\Tools\L2S\Lst2str.exe" /x:Path\to\textpad.exe /l:%L
lst2clip\ (List To Clipboard)
Copyright (C) 2003 Lefteous
https://ghisler.ch/board/viewtopic.php?f=6&t=1853
Ergänzung zu den internen Kommandos wie zB cm_CopyFullNamesToClip. Man kann genau festlegen wie die Pfade kopiert werden.
"%COMMANDER_PATH%\Tools\Lst2Clip\Lst2Clip.exe" /R:"ftp:"="http:" /L:"%P"
lst2clip-u\
About the same as Lst2Clip, only with unicode support, long paths and with some inconsequential little things
additions and corrections welcome
List To MultiInstance aka L2M
http://totalcmd.net/plugring/listm.html
Copyright (c) 1999-2001 by Andrey V. Sorokin
l2m.exe /L:<List file> [/X:<Execute program>] [/B:<before param>] [/E:<end param>] [/W] [/S] [/P] [/F:<pause>] [/G:<gui mode>] [/R:<RegExp>] [/I] /J:<project>] [/M:<window_mode>] [/O:<priority>]
or
l2m.exe <filename>
List2Run\
http://ghisler.ch/board/viewtopic.php?t=3418
lst2run [-h] [-e [exe]] [-s [expression]] [-l [list.file]] [-w [ms.]][-p [ms.]] [-b]
lst2str\
http://www.ghisler.com/dtools.htm
lst2str /X:[program.exe] /L:[listfile] /F:[file] /N:[nnn] /W:[state] /C:[nnn] /S:[switches]
C:\wincmd\lst2str.exe /X:"C:\Program Files\ExamDiff Pro\ExamDiff.exe" /L:%L /F:%T%M /N:2
"%COMMANDER_PATH%\Tools\L2S\Lst2str.exe" /x:Path\to\textpad.exe /l:%L
lst2clip\ (List To Clipboard)
Copyright (C) 2003 Lefteous
https://ghisler.ch/board/viewtopic.php?f=6&t=1853
Ergänzung zu den internen Kommandos wie zB cm_CopyFullNamesToClip. Man kann genau festlegen wie die Pfade kopiert werden.
"%COMMANDER_PATH%\Tools\Lst2Clip\Lst2Clip.exe" /R:"ftp:"="http:" /L:"%P"
lst2clip-u\
About the same as Lst2Clip, only with unicode support, long paths and with some inconsequential little things
additions and corrections welcome
Re: F4 - edit multiple selected files?
and without third party software?
maybe em_ command?
maybe em_ command?
OS: Win10 | TC: latest x64
Re: F4 - edit multiple selected files?
Of course - you can assign such a command to ANY key!
Re: F4 - edit multiple selected files?
Yes, possible too.
- select all files
- run a script (JS, VBS, AHK, PoSh, Batch, called via button or shortcut) and pass TC-parameter like "%L" (contains all selected files, one by line)
- the script should loop over the temp file (created by the %L-option) and call your editor for each line of that temp file
Re: F4 - edit multiple selected files?
usercmd.ini:
Code: Select all
[em_notepadplus]
cmd=%commander_path%\Utils\Notepad++\notepad++.exe
param=%P%S
wincmd.ini
Code: Select all
[Shortcuts]
F4=em_notepadplus
Last edited by petermad on 2023-07-27, 12:18 UTC, edited 2 times in total.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: F4 - edit multiple selected files?
I discussed about it with Christian. As far as I know it will be not implemented natively.
But, it can be done using external tools (or by setting a custom shortcut).
I implemented such functionality in my Ultimate File Manager project. It will be however available in next release (UFM 11 - when TC 11 will be released).
Thanks to UFM Shell Manager, you can assign application to chosen extensions (file types). Both for F3 (Open Action) and F4 (Edit Action).
You don't have to set custom shortuct fot TC using defined custom command (like @petermad showed).
Example:
https://www.dropbox.com/scl/fi/0u86b8qs9aipjyvu1jyf3/F3F4.mp4?rlkey=emejq5tph7uwagn3ankvjzic9&dl=0
UFM: https://pawelporwisz.pl/ufm/ufm.php
-Pawel
But, it can be done using external tools (or by setting a custom shortcut).
I implemented such functionality in my Ultimate File Manager project. It will be however available in next release (UFM 11 - when TC 11 will be released).
Thanks to UFM Shell Manager, you can assign application to chosen extensions (file types). Both for F3 (Open Action) and F4 (Edit Action).
You don't have to set custom shortuct fot TC using defined custom command (like @petermad showed).
Example:
https://www.dropbox.com/scl/fi/0u86b8qs9aipjyvu1jyf3/F3F4.mp4?rlkey=emejq5tph7uwagn3ankvjzic9&dl=0
UFM: https://pawelporwisz.pl/ufm/ufm.php
-Pawel
Re: F4 - edit multiple selected files?
This is the nearly complete right answer. Use: param=%P%Spetermad wrote: 2023-07-27, 10:05 UTC usercmd.ini:wincmd.iniCode: Select all
[em_notepadplus] cmd=%commander_path%\Utils\Notepad++\notepad++.exe param=%S
Code: Select all
[Shortcuts] F4=em_notepadplus
Joube
If using Notepad++ (at that path: %commander_path%\Utils\Notepad++\notepad++.exe)

Re: F4 - edit multiple selected files?
2JOUBE
Notice that TC always sets the current path (if path= is not defined for the em_command), and apparantly that is enough for notepad++ to accept filenames without path.
I had that at first - but then I tested it and it works without %P (for notepad++), and since there is a limit of about 1018 characters to the parameter field, using only %S saves a lot of characters - so you can select more files without %P.This is the nearly complete right answer. Use: param=%P%S
Notice that TC always sets the current path (if path= is not defined for the em_command), and apparantly that is enough for notepad++ to accept filenames without path.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: F4 - edit multiple selected files?
petermad wrote: 2023-07-27, 10:05 UTCusercmd.ini:Then you can assign em_notepadplus to F4Code: Select all
[em_notepadplus] cmd=%commander_path%\Utils\Notepad++\notepad++.exe param=%S
wincmd.iniCode: Select all
[Shortcuts] F4=em_notepadplus
Thanks for helping out petermad.
My suggestions:
Always add quotes (as Dalai says):
Code: Select all
[em_notepadplus]
cmd="%commander_path%\Utils\Notepad++\notepad++.exe"
param=%S
Then you can assign em_notepadplus for example to F4 or any other key, e.g. Alt+F4 (overwriting Exit, close program) or use this em_command as command in a button.
Re: F4 - edit multiple selected files?
If you use it with files from different folders (e.g. Find files -> Feed to listbox) the better solution is param=%P%S. So use it in every cases. (acording help: commad line: 32767 chars)petermad wrote: 2023-07-27, 10:49 UTC 2JOUBEI had that at first - but then I tested it and it works without %P (for notepad++), and since there is a limit of about 1018 characters to the parameter field, using only %S saves a lot of characters - so you can select more files without %P.This is the nearly complete right answer. Use: param=%P%S
Notice that TC always sets the current path (if path= is not defined for the em_command), and apparantly that is enough for notepad++ to accept filenames without path.
Re: F4 - edit multiple selected files?
You got a point there.If you use it with files from different folders (e.g. Find files -> Feed to listbox) the better solution is param=%P%S
It depends on the command, for the cd command it is only around 1020 ( https://ghisler.ch/board/viewtopic.php?t=54497 )acording help: commad line: 32767 char
But I checked with notepad++.exe - there is no such low limit - I guess the limit for external programs is the 32767 that is the limit for %S.
I have reinserted %P in my previous post about the em_command.
Quotes are not mandatory for program names in the Command field even if the paths contains spaces - but the quotes doesn't harm.Stefan2 wrote:Always add quotes (as Dalai says):
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: F4 - edit multiple selected files?
In fact, adding quotes to the ini as shown by Stefan2 doesn't do anything, does it?petermad wrote: 2023-07-27, 12:18 UTCQuotes are not mandatory for program names in the Command field even if the paths contains spaces - but the quotes doesn't harm.Stefan2 wrote:Always add quotes (as Dalai says):