User Menu according to file name/type

Something is missing in Far Manager? You have a great idea that should be heard? Write here.
Post Reply
cyberwolf
Posts: 109
Joined: Tue 24 Mar, 2009 14:39
Been thanked: 2 times

User Menu according to file name/type

Post by cyberwolf »

I don't know if this has been discussed before or not (a quick search didn't return any post), but I would like to be able to have User Menus (those shown when you press the F2 button) according to the file name or file extension of the current file/files.

The way I imagined it it would be something like the user has multiple UserMenu.ini files (for example usermenu_doc.ini, usermenu_audio.ini, ..), each one has in it at the start a filter for what type of files it's active, something like :

Code: Select all

[Active]
Filename=*.ini, *.diz, *.nfo
Also, there should be the possibility to include one usermenu in another, that way we could make a usermenu with generic commands (that apply to all files) and include it in all the other menu files.

I'm not exactly sure how this should work when multiple files are selected, since the files might respect different filters.
Also there could be 2 menu's that apply to the same file because of the filters, maybe in this case it should show a menu containing both usermenu's (maybe as submenus ?)

For now I have one usermenu with all the commands that i might apply to files, but it's not the best idea since i have audio editor, video editor, image editor, hex viewer, office viewer/editor commands and a few more and of course most of those commands don't apply to most of the files.

Another idea would be to have a plugin or program (maybe a LUA script ?) that would be called from the usermenu and depending on the file name/type would show a customizable menu for further commands, that way in the usermenu.ini file i would only have one entry : "view.exe !.!" that would call the plugin/program/script.

Is this possible and if not then what do you think should it be possible to be done in FAR or it's not something you would use. :?:
Sorry for writing in English in the Russian forums, but i don't speak Russian and don't trust online translators. :D

"There’s no teacher who can teach anything new He can just help us to remember the things we always knew." ~ ENIGMA
User avatar
HaRT
Moderator
Posts: 10822
Joined: Tue 30 Aug, 2005 17:21
Has thanked: 221 times
Been thanked: 358 times

Re: User Menu according to file name/type

Post by HaRT »

Doesn't the Format Menu plugin do what you are suggesting?
Note: it's not adapted for FAR3 yet.
Фар есть инструмент, а не нянька. © 2009 DrKnS
cyberwolf
Posts: 109
Joined: Tue 24 Mar, 2009 14:39
Been thanked: 2 times

Re: User Menu according to file name/type

Post by cyberwolf »

Oops, i forgot to mention that i need it for FAR3.

Thanx Hart, i didn't know about Format Menu, i'll probably have to wait for it to be upgraded (or maybe Far2Wrap to support this plugin too).
Sorry for writing in English in the Russian forums, but i don't speak Russian and don't trust online translators. :D

"There’s no teacher who can teach anything new He can just help us to remember the things we always knew." ~ ENIGMA
User avatar
HaRT
Moderator
Posts: 10822
Joined: Tue 30 Aug, 2005 17:21
Has thanked: 221 times
Been thanked: 358 times

Re: User Menu according to file name/type

Post by HaRT »

cyberwolf wrote:Oops, i forgot to mention that i need it for FAR3.
The ANSI version of the plugin should work in FAR3.
Фар есть инструмент, а не нянька. © 2009 DrKnS
User avatar
Raistlin
Posts: 750
Joined: Wed 16 Mar, 2005 16:01
Has thanked: 3 times
Been thanked: 1 time

Re: User Menu according to file name/type

Post by Raistlin »

cyberwolf
File Associations don't suit your needs? You can get everything you mention using them, except the case with multiple selection.
Magically yours
Raistlin
cyberwolf
Posts: 109
Joined: Tue 24 Mar, 2009 14:39
Been thanked: 2 times

Re: User Menu according to file name/type

Post by cyberwolf »

Raistlin wrote:cyberwolf
File Associations don't suit your needs? You can get everything you mention using them, except the case with multiple selection.
I have never worked with File Associations, so my question might be stupid, but can i show a menu with multiple options for a file ?
For example for cpp files i would need to add the following shortcuts : text editor, Visual Studio, SVN/VCS checkin/checkout, hex editor and for images i have about 6 or 7 programs. I would like to have one shortcut that shows all the options i can have for that file.

I would prefer one shortcut that shows a menu because there are filetypes that i work rarely with and if i have 6 shortcuts (like in the File Associations) i will most likely not remember what each shortcut does (I don't have a very good memory :D)
HaRT wrote:The ANSI version of the plugin should work in FAR3.
As I was writing the response I just realized that the Format Menu 0.5 version IS and ANSI version so it would work on FAR3 without anything else (like wrappers or stuff). I was confused since the plugin doesn't show up on the Options->Plugins Options but it does show up on the Plugins list and works correctly.

Thanx for your help.
Sorry for writing in English in the Russian forums, but i don't speak Russian and don't trust online translators. :D

"There’s no teacher who can teach anything new He can just help us to remember the things we always knew." ~ ENIGMA
User avatar
Raistlin
Posts: 750
Joined: Wed 16 Mar, 2005 16:01
Has thanked: 3 times
Been thanked: 1 time

Re: User Menu according to file name/type

Post by Raistlin »

I have never worked with File Associations, so my question might be stupid, but can i show a menu with multiple options for a file ?
Sure. Creating more than one association with "rare" actions defined for the same key combination (you may choose from Enter, Ctrl-PgDn, F3, Alt-F3, F4, Alt-F4 - I prefer Alt-F4) will give you the menu.
Magically yours
Raistlin
cyberwolf
Posts: 109
Joined: Tue 24 Mar, 2009 14:39
Been thanked: 2 times

Re: User Menu according to file name/type

Post by cyberwolf »

Raistlin wrote:
I have never worked with File Associations, so my question might be stupid, but can i show a menu with multiple options for a file ?
Sure. Creating more than one association with "rare" actions defined for the same key combination (you may choose from Enter, Ctrl-PgDn, F3, Alt-F3, F4, Alt-F4 - I prefer Alt-F4) will give you the menu.
Thanx, i didn't know that, i thought that associations were unique (as in you couldn't add the same file type twice). I'll look into it, File Associations seems more versatile (since it has 6 shortcuts) than Format Menu.
Hm, i could actually combine them both (i might use the UserMenu too for some programs), I just hope I won't get lost in all the settings :)
Sorry for writing in English in the Russian forums, but i don't speak Russian and don't trust online translators. :D

"There’s no teacher who can teach anything new He can just help us to remember the things we always knew." ~ ENIGMA
User avatar
Raistlin
Posts: 750
Joined: Wed 16 Mar, 2005 16:01
Has thanked: 3 times
Been thanked: 1 time

Re: User Menu according to file name/type

Post by Raistlin »

IMHO you can use User Menu for this but actually have no reason - it would be just some kind of NC legacy. File Associations are surely "must use" if an action you want to automate applies to current object.
Magically yours
Raistlin
cyberwolf
Posts: 109
Joined: Tue 24 Mar, 2009 14:39
Been thanked: 2 times

Re: User Menu according to file name/type

Post by cyberwolf »

Raistlin you're right, i forgot to mention that i don't use the UserMenu to have actions according to the current file.
I use the UserMenu to start some applications that require the current folder (not the file) and also to have a list of applications that i can run (ones that do not require a file/folder, for example CCLeaner, RegCleaner, DiskDefrag and the likes).

P.S. there is one exception, i added an option to compare the current files from the active and passive panel, it could probably be accomplished with File Associations and Format Menu too since those support the "!#" sign that is used for the passive panel.
Sorry for writing in English in the Russian forums, but i don't speak Russian and don't trust online translators. :D

"There’s no teacher who can teach anything new He can just help us to remember the things we always knew." ~ ENIGMA
Post Reply

Return to “Suggestions and Ideas”