User Menus

English support forum

Moderators: white, Hacker, petermad, Stefan2

User avatar
sqa_wizard
Power Member
Power Member
Posts: 3862
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

It may help, if you play a little bit around with the "%L" parameter.

Try : program.exe input=%L

where the program.exe is your application ...

The %L gives a listname of the selected files.

For further information check the Help (section 3c. Menus / Start)
#5767 Personal license
User avatar
cyberclops
Junior Member
Junior Member
Posts: 12
Joined: 2003-02-06, 20:01 UTC
Location: Austin, Texas

Post by *cyberclops »

Valentino wrote:You can do almost the same in TC: "Alt+S" opens Start menu, then you can press the initial letter of your command's title to invoke that command. For example, if you have Start menu entry "Make my program" you can press Alt+S,M.
You can also use & sign in command titles, like "Ma&ke my program". In this case you can activate it by pressing "Alt+S,K". You can use this "&" if you have several commands whose titles start with the same letter.
One more note: if you have "Quick search (current dir): Alt+Letters" option on, you'll have to press "Alt,S,M" to activate the command (separate pressing "Alt" and "S").
Thanks for the help. This works great except that I have to use some letter other than 'M' or 'S' because they are being used for "Change &Start Menu" and "Change &Main Menu.
Valentino wrote:To prevent closing the window after command terminates you can use the following (at least under Win NT4, 2000, XP):
Command: cmd.exe
Parameters: /k make.exe -m ........
I have been using these as well as Shift+Enter when entering a command directly, but I keep forgetting and don't remeber until the window vanishes before I can see and read the results. I was just looking for a more 'foolproof' way.
Lowell
-------
There are 10 types of people in the world ...
Those who understand binary ...
And those who do not.
User avatar
cyberclops
Junior Member
Junior Member
Posts: 12
Joined: 2003-02-06, 20:01 UTC
Location: Austin, Texas

Post by *cyberclops »

ghisler(Author) wrote:Could this directory menu access the selected files? If not, you can solve this with a simple batch file called usermenu.bat or so, which you place in every dir where you need it, and pass the file name under the cursor to it as a parameter. The batch file can then implement a simple menu, e.g. with the choice command.

...

Put the program name in a batch file, e.g. program.bat. Then press Alt+Enter on that batch file, and check the option to keep the window open. Or even better, uncheck this option, and add a second line to the batch file reading
pause
This works and I have tried it, but one annoying problem arises. I use the commands to fire off parts of my organizations build process. The tools we use are all old MS-DOS based tools (TASM, TLINK, Opus Make) that when run with an layer of batch files run out of memory.
Lowell
-------
There are 10 types of people in the world ...
Those who understand binary ...
And those who do not.
User avatar
cyberclops
Junior Member
Junior Member
Posts: 12
Joined: 2003-02-06, 20:01 UTC
Location: Austin, Texas

Post by *cyberclops »

sqa_wizard wrote:What is the exact filename and syntax of those directory specific menues ?
The filename was always "NC.MNU"

The syntax was very simple

hotkeyA: TitleA
commandA1
...
commandAN
hotkeyB: TitleB
commandB1
...
commandBN

You could even have nested menus

hotkeyA: MenuTitleA
{
hotkeyB: TitleB
commandB1
...
commandBN
hotkeyC: TitleC
commandC1
...
commandCN
}

Here is a simple example of on of my menu file

T: Tags
tags.bat
M: Make
make -m
C: Clean
make -m clean
S: Sweepget
sweep get -u *.??v
X: Xfr
xfr.bat
Lowell
-------
There are 10 types of people in the world ...
Those who understand binary ...
And those who do not.
User avatar
cyberclops
Junior Member
Junior Member
Posts: 12
Joined: 2003-02-06, 20:01 UTC
Location: Austin, Texas

Post by *cyberclops »

Geoffrey wrote:Another feature I would find useful in user menus: would it be possible to apply the same command to selected files, instead of just the file under the cursor ?
Norton Commander did not do this, infact there was no way to pass any dynamic parameters to the menus. In this respect (and many others) TC is far superior. I have tried out another competing product that is very similar to NC. This program is called File Commander (http://silk.apana.org.au/fc.html) and it allows processing of the selection list in one of two ways. First, you can pass the entire selection list as parameters separated by spaces to one invocation of a command. Second, you can invoke the command one time for every item in the selection list passing only that item. If TC had something like this ...
Lowell
-------
There are 10 types of people in the world ...
Those who understand binary ...
And those who do not.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6481
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

Geoffrey wrote:Thanks for the tip, it might be useful.

However, it does not solve my problem, since the program I try to execute takes itself the input file as an option argument (of the form input=...)

Regards,
Geoffrey
Look in the help while defining a button and see the description of %L
User avatar
Black Dog
Power Member
Power Member
Posts: 1024
Joined: 2003-02-05, 22:17 UTC
Location: Odessa
Contact:

Post by *Black Dog »

[face=courier]On 12-02-2003 18:42:21 +0000 cyberclops wrote:

c> I have to use some letter other than 'M' or 'S'
c> because they are being used for "Change &Start
c> Menu" and "Change &Main Menu.


You can change them.[/face]
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

2cyberclops
Second, you can invoke the command one time for every item in the selection list passing only that item. If TC had something like this
You can do this via the %L list command combined with the list2multi addon from our addons page!
Author of Total Commander
https://www.ghisler.com
User avatar
Hacker
Moderator
Moderator
Posts: 13064
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

c> I have to use some letter other than 'M' or 'S'
c> because they are being used for "Change &Start
c> Menu" and "Change &Main Menu.

You can change them.


... in your LNG file. Christian, could you please post the english LNG file on this forum again for anyone to download?

TIA
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Author of Total Commander
https://www.ghisler.com
Geoffrey
Junior Member
Junior Member
Posts: 73
Joined: 2003-02-11, 10:53 UTC
Location: France/Belgium
Contact:

Post by *Geoffrey »

It's not completely correct that the %L option can make it

For what I see/understand, used together with lst2mlt, it allows you to apply some program to all selected files, but this works only if the program command line looks like:
program.exe [options] file

On the other hand, passing the argument %L to a program, like in the case I mentioned:
program.exe input=file
would lead to process the file list, and not each file separately.

The solution I see would be to either add a '%' parameter to TC, such that it would process each selected file (I guess this should not be too difficult to implement, based on the code used for the %L parameter), or to add to lst2mlt similar '%' parameters

Anyway, thanks to all of you who tried to help

Regards,
Geoffrey
User avatar
Black Dog
Power Member
Power Member
Posts: 1024
Joined: 2003-02-05, 22:17 UTC
Location: Odessa
Contact:

Post by *Black Dog »

[face=courier]On 13-02-2003 18:34:21 +0000 Geoffrey wrote:

G> On the other hand, passing the argument %L to a
G> program, like in the case I mentioned:
G> program.exe input=file
G> would lead to process the file list, and not each
G> file separately.


I'm not quite sure I understood you. Of course the program should have an ability to process list files, if you want it to work with "%L". For example, to check selected files with AVPro I use this syntax:

Command: drive:\my\path\to\avp32.exe
Parameters: /@=%L

there "/@=" is list file parameter.

G> The solution I see would be to either add a '%'
G> parameter to TC, such that it would process each
G> selected file


L2M provide the support of list files to the programs w/o it by default. And it works exactly this way - makes the program process each path in a list file Commander generate.[/face]
Geoffrey
Junior Member
Junior Member
Posts: 73
Joined: 2003-02-11, 10:53 UTC
Location: France/Belgium
Contact:

Post by *Geoffrey »

Ok, I tried with L2M, and I could manage it with the "/B:input=" parameter.
However, some part of the problem remains, as the fact that my program produces an output file, that needs to be specified too... and I'd like to have one output file per input file.

Is there any way to specify options, such that I would have:
program.exe input=file output=%T/file for each and any file in %L ?

Thanks
Geoffrey
Gregory
Junior Member
Junior Member
Posts: 89
Joined: 2003-02-08, 10:04 UTC
Location: Kiev, Ukraine

Post by *Gregory »

2batchman61
batchman61 wrote:
i'm using "local" button bars (_local.bar) for directory specific functionality.

The main button bar (wincmd.ini [Buttonbar] Buttonbar=xxx) holds an entry which points to a local bar file (cmd**=.\_local.bar).
Does this works normally at your system?
I can't edit those bars and drag items on them cause all the changes I've made aren't saved.
Well... sometimes they are saved but not often.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Using such a name is usually a bad idea, because '.' means the current directory, which isn't always identical with the directory shown in the active panel...
Author of Total Commander
https://www.ghisler.com
Post Reply