User Menu according to file name/type

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

User Menu according to file name/type

Postby cyberwolf » Wed 06 Feb, 2013 11:44

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: 7906
Joined: Tue 30 Aug, 2005 17:21
Location: Санкт-Петербург
Has thanked: 63 times
Been thanked: 94 times

Re: User Menu according to file name/type

Postby HaRT » Wed 06 Feb, 2013 12:18

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

Re: User Menu according to file name/type

Postby cyberwolf » Wed 06 Feb, 2013 13:39

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: 7906
Joined: Tue 30 Aug, 2005 17:21
Location: Санкт-Петербург
Has thanked: 63 times
Been thanked: 94 times

Re: User Menu according to file name/type

Postby HaRT » Wed 06 Feb, 2013 14:44

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: 658
Joined: Wed 16 Mar, 2005 16:01
Location: St. Petersburg
Has thanked: 1 time
Contact:

Re: User Menu according to file name/type

Postby Raistlin » Wed 06 Feb, 2013 16:34

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

Re: User Menu according to file name/type

Postby cyberwolf » Thu 07 Feb, 2013 09:20

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: 658
Joined: Wed 16 Mar, 2005 16:01
Location: St. Petersburg
Has thanked: 1 time
Contact:

Re: User Menu according to file name/type

Postby Raistlin » Thu 07 Feb, 2013 09:39

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

Re: User Menu according to file name/type

Postby cyberwolf » Thu 07 Feb, 2013 10:05

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: 658
Joined: Wed 16 Mar, 2005 16:01
Location: St. Petersburg
Has thanked: 1 time
Contact:

Re: User Menu according to file name/type

Postby Raistlin » Thu 07 Feb, 2013 11:20

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

Re: User Menu according to file name/type

Postby cyberwolf » Thu 07 Feb, 2013 12:19

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


Return to “Suggestions and Ideas”

Who is online

Users browsing this forum: No registered users and 2 guests