Help with special symbols in User Menu...

You have encountered a problem using Far Manager? Here you can get help.
pepak
Posts: 469
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 10 times
Been thanked: 34 times

FarMenu.ini syntax and special aliases

Post by pepak »

Latest post of the previous page:

Actually, it's in the English version too. Precisely where Shmuel wrote it would be.

Note that "name of current file without extension" should be "!", not "!^!".

Nested menus are not available in the stock FAR. I implemented a basic support for them and published it somewhere in the forum for an older build of FAR3, but there apparently wasn't any interest in it so I stopped updating it here and only use it in my own FAR build.

buniak_a_h
Posts: 1877
Joined: Sat 20 Apr, 2013 00:17
Location: Питер
Has thanked: 120 times
Been thanked: 167 times
Contact:

FarMenu.ini syntax and special aliases

Post by buniak_a_h »


Shmuel
Posts: 6138
Joined: Thu 23 Mar, 2006 21:36
Location: Israel
Has thanked: 31 times
Been thanked: 317 times

FarMenu.ini syntax and special aliases

Post by Shmuel »

SuperStainless,
- path of opposite panel () !#!\
- name of current file with full path (!\!.!) or? !\!.!
- name of current file in the opposite panel with full path () !#!\!.!
- list of all tagged files () !&

SuperStainless
Posts: 10
Joined: Sat 07 Mar, 2020 16:42
Been thanked: 1 time

FarMenu.ini syntax and special aliases

Post by SuperStainless »

Thank you to everyone! Now I can start again to move from my present Commander to FAR!
Nested menus would be useful, because I have a separated file for every menu, but available solution can work. I will adapt my menus. I have a lot of them...
Thank you again and, for the future, I will directly check the hlf files! :)

User avatar
HaRT
Moderator
Posts: 9443
Joined: Tue 30 Aug, 2005 17:21
Location: Санкт-Петербург
Has thanked: 105 times
Been thanked: 222 times

FarMenu.ini syntax and special aliases

Post by HaRT »

SuperStainless wrote:
Wed 15 Apr, 2020 16:12
Nested menus would be useful
Nested menus are supported, please refer to what buniak_a_h wrote above (at the very end of the spoiler-hidden text), but they will be stored in the same file as the top-level menu.
I suppose pepak meant including menus stored in other files, this is not supported by “stock” FAR.
Фар есть инструмент, а не нянька. © 2009 DrKnS

pepak
Posts: 469
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 10 times
Been thanked: 34 times

FarMenu.ini syntax and special aliases

Post by pepak »

That's what I meant - includes.

SuperStainless
Posts: 10
Joined: Sat 07 Mar, 2020 16:42
Been thanked: 1 time

FarMenu.ini syntax and special aliases

Post by SuperStainless »

You are right, "nested menu" are already present and working. I also meant menus in separate files: would be useful because you can compile the menu only one time and use it in different places.

SuperStainless
Posts: 10
Joined: Sat 07 Mar, 2020 16:42
Been thanked: 1 time

FarMenu.ini syntax and special aliases

Post by SuperStainless »

I cannot find a way to execute a command once for each tagged file. I try to better explain: I can get a list of all tagged files (!@FQ!) but I would also like to have the possibility to execute (directly from the menu) a command like this one:
7z t File1.ext
7z t File2.ext
where my tagged files are:
File1.ext
File2.ext

A more complex example:
Opposite panel: C:\temp
Current panel: C:\tmp
Selected directories from current panel: dir1 and dir2

I would like to execute these commands:
ConstantString1 C:\tmp\dir1 C:\temp\dir1 ConstantString2
ConstantString1 C:\tmp\dir2 C:\temp\dir2 ConstantString2

Something "like":
ConstantString1 !\!t !#!\!t ConstantString2

where "!t" is a single line of the tagged files (!@FQ!) list.

I would like to do everything inside the FAR, without using Python or external programmation. Thank you!

User avatar
HaRT
Moderator
Posts: 9443
Joined: Tue 30 Aug, 2005 17:21
Location: Санкт-Петербург
Has thanked: 105 times
Been thanked: 222 times

FarMenu.ini syntax and special aliases

Post by HaRT »

SuperStainless wrote:
Sat 25 Apr, 2020 14:40
execute a command once for each tagged file
You can construct your command using CMD's built-in FOR command like this: @for /f %I in (!@!) do @echo %I

18:30 MSK See for /? for (much) more detals.
Last edited by HaRT on Sat 25 Apr, 2020 16:30, edited 1 time in total.
Reason: Added a reference to the FOR help
Фар есть инструмент, а не нянька. © 2009 DrKnS

buniak_a_h
Posts: 1877
Joined: Sat 20 Apr, 2013 00:17
Location: Питер
Has thanked: 120 times
Been thanked: 167 times
Contact:

FarMenu.ini syntax and special aliases

Post by buniak_a_h »

See Ctrl+G -- Apply command for each file

SuperStainless
Posts: 10
Joined: Sat 07 Mar, 2020 16:42
Been thanked: 1 time

FarMenu.ini syntax and special aliases

Post by SuperStainless »

Thank you for the replies. But CTRL+G does not execute the command for every file but for all files (or I cannot understand how to use it). Anyway it is not useful for an highly automatic procedure.
The use of batch file does not give me the same power to do everything inside the FAR.

For example, how I can do, inside the FAR, if I tag "n" files and want to make "n" ZIP files, everyone with only one tagged file?

It is strange that no one has needed this function before, it is present from a lot of time.
Last edited by SuperStainless on Sun 26 Apr, 2020 00:13, edited 1 time in total.

buniak_a_h
Posts: 1877
Joined: Sat 20 Apr, 2013 00:17
Location: Питер
Has thanked: 120 times
Been thanked: 167 times
Contact:

FarMenu.ini syntax and special aliases

Post by buniak_a_h »

SuperStainless, no, Ctrl+G executes command for each selected file (if not - for current file). For example, your case:
Ctrl+G
7z a !.!.7z "!\!.!"

User avatar
HaRT
Moderator
Posts: 9443
Joined: Tue 30 Aug, 2005 17:21
Location: Санкт-Петербург
Has thanked: 105 times
Been thanked: 222 times

FarMenu.ini syntax and special aliases

Post by HaRT »

SuperStainless wrote:
Sun 26 Apr, 2020 00:12
The use of batch file does not give me the same power to do everything inside the FAR
You don't need a batch file, just write complex commands right in the user menu.
BTW files are being selected, not tagged.
Фар есть инструмент, а не нянька. © 2009 DrKnS

SuperStainless
Posts: 10
Joined: Sat 07 Mar, 2020 16:42
Been thanked: 1 time

FarMenu.ini syntax and special aliases

Post by SuperStainless »

OK, thank you, I understand.
But everytime I have to write the command "7z...". Is it possible to automate it inside the user menu?
I do not mean an history.

User avatar
HaRT
Moderator
Posts: 9443
Joined: Tue 30 Aug, 2005 17:21
Location: Санкт-Петербург
Has thanked: 105 times
Been thanked: 222 times

FarMenu.ini syntax and special aliases

Post by HaRT »

SuperStainless wrote:
Sun 26 Apr, 2020 15:21
Is it possible to automate it inside the user menu?
It is exactly what I'm suggesting above. And I'll give you no further guidance unless I see you employ your built-in intellect.
Фар есть инструмент, а не нянька. © 2009 DrKnS

SuperStainless
Posts: 10
Joined: Sat 07 Mar, 2020 16:42
Been thanked: 1 time

FarMenu.ini syntax and special aliases

Post by SuperStainless »

I have to operate with tagged files, not selected files. With selected file is easier but a different thing. I think I will solve the problem with an external Python script.
Thank you.

Post Reply

Return to “Support and Troubleshooting”