Xplorer2Hack: Menu++ Customizable menu for Xplorer2

A collection of especially useful xplorer² topics and ideas. New users may find it helpful to look here before searching the other forums for information. >>>>>> Please post new material in the relevant forum. (New stuff posted here will be removed.) Thanks. -fg-

Moderators: fgagnon, nikos

User avatar
snakebyte
Gold Member
Gold Member
Posts: 430
Joined: 2003 May 07, 07:14
Location: Seattle
Contact:

Xplorer2Hack: Menu++ Customizable menu for Xplorer2

Post by snakebyte » 2007 Feb 20, 09:00


A favorite of folks who want to customize the menus in xplorer².  
This topic thread was originally posted  in the xplorer² Professional forum.        Moved here 19-May-2010 =fg=
===============================================================================


Guys, I wrote this tool over the weekend and wanted to share it with you. Menu++ extends Xplorer2 with customizable user menus. It is similar to MenuHack. Apart from command ids, Menu++ supports other command invocation methods like sending direct keystrokes to xplorer2

With Menu++ you can
- Group your favorite and frequently used commands together.
- Make deeply nested menu commands more accessible.
- Combine multiple xplorer2 actions as a single menu command.
- Convert xplorer2 “hotkey only” commands into menu commands.  No need to remember those cryptic hotkeys.  
- Use it as a cheat sheet to list xplorer2 hotkeys.
- Launch any external application or a script.
- Open bookmark folders in new tab
- Using a Laptop? You can now use those Num pad hotkeys you always missed.

Menu++ is config based tool and it can be launched as a user command from Xplorer2.

Image

Whats more? You can have multiple instances of customizable menus by passing different config files to Menu++.exe as multiple user commands.

Take it for a spin and let me know what you think.
http://hacks.anunay.com/xplorer2/downlo ... usPlus.zip

Installation
1. Unzip Menu++.exe, config.ini and display.ini to any folder of your choice. (say C:\My Downloads\Menu++)

2. Create two user commands in Xplorer2 as

Code: Select all

Name: Menu1 
Description: >"C:\My Downloads\Menu++\Menu++.exe" config.ini $S

Name: Menu2 
Description: >"C:\My Downloads\Menu++\Menu++.exe" display.ini $S
Note: Don't skip ">" symbol at the start of your description.

3. Add these two commands to your toolbar (Right click on your toolbar and choose customize. Add "Menu1" and "Menu2" commands that you created earlier from left list box to the right one).

4. Now you can use these two toolbar buttons to launch your custom menus. Use the 'Configure...' menu item at the end, to edit the configuration file associated with that particular instance of Menu++.

The included readme file has the config file syntax details. I have tried to use different action types in config.ini and display.ini for your reference. Use these files as starting point for your own customizable menus.

Good Luck.


[ A favorite topic: moved from x² Pro forum  -fg- ]
Last edited by snakebyte on 2008 Jun 19, 21:26, edited 3 times in total.
Help! I'm an AI running around in someone's universe simulator.

Demetris
Silver Member
Silver Member
Posts: 217
Joined: 2004 Jul 04, 17:18

Post by Demetris » 2007 Feb 20, 10:42

Very good idea, useful, and easy to set up!

I think it would be very good if x2 included something like this by default, as well as something like Wasker’s config editor.

I’m curious: what is it made with?

User avatar
nikos
Site Admin
Site Admin
Posts: 14355
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Post by nikos » 2007 Feb 20, 11:53

that's impressive snakebyte, you nearly wrote your own file manager there from scratch :)

clearly you'll like the "pick custom icon for toolbar command" feature when it is introduced!

User avatar
FrizzleFry
Platinum Member
Platinum Member
Posts: 1141
Joined: 2005 Oct 16, 19:09

Post by FrizzleFry » 2007 Feb 20, 16:11

This is very cool.  I have already set up a couple of menus to reduce the number of user commands and toolbar buttons I had setup.

Edit: Is there a way to access or send x2's batch tokens to the menu commands?  I have a few user commands that run in the current folder but use $I access the inactive pane's folder.  Or use the currently selected file(s) as parameters.

If not, then I would suggest adding the ability to pass extra parameters to Menu++ that could be used by the commands in the menu.  Similar to batch file parameters.

User avatar
snakebyte
Gold Member
Gold Member
Posts: 430
Joined: 2003 May 07, 07:14
Location: Seattle
Contact:

Post by snakebyte » 2007 Feb 20, 19:21

Demetris wrote:I’m curious: what is it made with?
I have written Menu++ using Autohotkey. I got this idea around 7 months back and I tried implementing it using MFC, C# and autoit3. I didn't want a memory resident application always running in system tray. My code was getting complicated as it was difficult to implement menu without main window body.

Recently I was reading Autohotkey help and I found that autohotkey has this ability to run blocks of code automatically in a new thread without having to do anything. Also it has very easy API to create Menus. This greatly simplified my implementation of Menu++. I also took advantage of WinMenuSelectItem, Send and Run APIs to create different actions types for Menu++

Being a programmer, I don't like the non-standard syntax style of Autohotkey, but I must agree that it packs lot of punch. You can achieve a lot by writing very few lines of code. Menu++ has hardly 150 lines of code, 60% of which is just config file parsing code.
nikos wrote:clearly you'll like the "pick custom icon for toolbar command" feature when it is introduced!
Nikos, if my xplorer2 screenshot makes you implement custom icons any sooner, then all the effort that I have put in Menu++ has been already paid off :).
FrizzleFry wrote:Is there a way to access or send x2's batch tokens to the menu commands?  I have a few user commands that run in the current folder but use $I access the inactive pane's folder.  Or use the currently selected file(s) as parameters.

If not, then I would suggest adding the ability to pass extra parameters to Menu++ that could be used by the commands in the menu.  Similar to batch file parameters.
While writing Menu++, I thought over this feature. Implementing x2's tokens in Menu++ would be like re-inventing the wheel. However, there is a very simple workaround for this. Create a user command that uses the x2's batch tokens. Don't add this user command to x2 toolbar, but add it to Menu++ config file instead. See the example below

Code: Select all

Title='My User Command'
Action=Menu,10&,3&,[POSITION_OF_YOUR_USER_COMMAND]&
Last edited by snakebyte on 2007 Feb 21, 00:11, edited 1 time in total.
Help! I'm an AI running around in someone's universe simulator.

User avatar
FrizzleFry
Platinum Member
Platinum Member
Posts: 1141
Joined: 2005 Oct 16, 19:09

Post by FrizzleFry » 2007 Feb 20, 23:31

snakebyte wrote:While writing Menu++, I thought over this feature. Implementing x2's tokens in Menu++ would be like re-inventing the wheel. However, there is a very simple workaround for this. Create a user command that uses the x2's batch tokens. Don't add this user command to x2 toolbar, but add it to Menu++ config file instead.
I guess I see your point. I'll try your workaround.

I did run into a small problem: Menu++ will not correctly run commands which include the comma character.  I assume this is because the comma is used as a delimiter.  Enclosing the command in quotes did not help.

User avatar
fgagnon
Site Admin
Site Admin
Posts: 3737
Joined: 2003 Sep 08, 19:56
Location: Springfield

Post by fgagnon » 2007 Feb 20, 23:57

Don't know it it would work, but did you try the double comma trick (,,) to 'escape' it as a delimiter?

User avatar
snakebyte
Gold Member
Gold Member
Posts: 430
Joined: 2003 May 07, 07:14
Location: Seattle
Contact:

Post by snakebyte » 2007 Feb 21, 00:00

FrizzleFry wrote: I did run into a small problem: Menu++ will not correctly run commands which include the comma character.  I assume this is because the comma is used as a delimiter.  Enclosing the command in quotes did not help.
Yeah I'm aware of this issue. Try passing ascii value or virtual key code for comma character.
{ASC nnnnn} or {vkXX}{scYYY}{vkXXscYYY}.
See Autohotkey send command for details. http://www.autohotkey.com/docs/commands/Send.htm

Let me know if you can get this to work, otherwise I'll implement a workaround for comma character.

Edit: Try  "{ASC 44}" (Without quotes) instead of comma.
Help! I'm an AI running around in someone's universe simulator.

User avatar
vserghi
Silver Member
Silver Member
Posts: 303
Joined: 2002 Mar 19, 08:54
Location: UK

Post by vserghi » 2007 Feb 21, 09:44

Wow, well done. This is quite powerful.

I have used AutohotKey before for minor things, but this is pretty cool. Big pat on the back.
Vas

Demetris
Silver Member
Silver Member
Posts: 217
Joined: 2004 Jul 04, 17:18

Post by Demetris » 2007 Feb 21, 11:35

snakebyte wrote:
Demetris wrote:I’m curious: what is it made with?
I have written Menu++ using Autohotkey. I got this idea around 7 months back and I tried implementing it using MFC, C# and autoit3. I didn't want a memory resident application always running in system tray. My code was getting complicated as it was difficult to implement menu without main window body.

Recently I was reading Autohotkey help and I found that autohotkey has this ability to run blocks of code automatically in a new thread without having to do anything. Also it has very easy API to create Menus. This greatly simplified my implementation of Menu++. I also took advantage of WinMenuSelectItem, Send and Run APIs to create different actions types for Menu++

Being a programmer, I don't like the non-standard syntax style of Autohotkey, but I must agree that it packs lot of punch. You can achieve a lot by writing very few lines of code. Menu++ has hardly 150 lines of code, 60% of which is just config file parsing code.
Thanks for the answer!

I thought it maybe was AutoHotkey, but I just didn’t know that something like this can be made with AHK. :-) Really neat!

longfellow
Silver Member
Silver Member
Posts: 226
Joined: 2004 Jun 16, 15:09

Post by longfellow » 2007 Feb 22, 15:16

Very nice, indeed!  Simple to use, yet powerful.  Impressive use of AHK; I had no idea one could do something like this without having an AHK script loaded.

Thanks for sharing this great tool!

Mr.Pleasant
Silver Member
Silver Member
Posts: 281
Joined: 2006 Dec 29, 12:56
Location: Utrecht, NL

Post by Mr.Pleasant » 2007 Feb 22, 22:05

I think I'll like this one! Thanks, Snakebyte! Very nice you're sharing it with us 8)

Stacey23
Member
Member
Posts: 28
Joined: 2006 Jul 21, 19:42

Post by Stacey23 » 2007 May 06, 09:02

HI snakebyte, great great tool.

This suggestion works well too
Title='My User Command'
Action=Menu,10&,3&,[POSITION_OF_YOUR_USER_COMMAND]&
hmm just a suggestion, maybe posts like these can be made sticky so members who dont get to check on the boards often get to see tools such as these right away.

thanks again snakebyte.

User avatar
nikos
Site Admin
Site Admin
Posts: 14355
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Post by nikos » 2007 May 06, 20:40

i think this is mentioned in the manual, nie?

User avatar
snakebyte
Gold Member
Gold Member
Posts: 430
Joined: 2003 May 07, 07:14
Location: Seattle
Contact:

Post by snakebyte » 2007 May 07, 01:52

I think Menuhack is mentioned indirectly as Autoit3 script but Menu++ is not there.
Help! I'm an AI running around in someone's universe simulator.

Post Reply