One of the first things I did with my shiny new copy of Toolbox was write myself a menu system.
Particularly as the Windows Start menu has lost a lot of the structural features it had back in the day. I can't help it, I want to organise things.
So there's a command that makes doing this sort of thing straightforward, but if you're planning on a big structure, life gets a bit... tedious.
So this is a tutorial on an easy way to make yourself something useful.
Prerequisite: you need to know at least a little about where programs live on your computer. Beyond that, I'll try to hold your hand a little.
Optional extra, but I rely on this a lot. Make yourself an action like this:
(Start)
HOW TO USE: Copy from Start to End, and then paste into an action.
REFERENCE : See an example of pasting at alomware.com/paste.png
0001 Alert: Ask for a file as "exe,com,cmd"
0002 String: Assign "alert$"
0003 String: Replace regex text "$3,dos:$1$3$4,icon=$1$3$4 from ^(.*[\\/])(["']?)([^\\/]+?)(\.[^\\.¬
]+)?\2$"
0004 String: Replace text ""="
0005 Clipboard: Assign text "string$"
0006 Keyboard: Paste ""
(End)
I have this on
Alt-Win-P but do whatever's comfortable.
What it does, is lets you navigate to a program on your computer (line 0001) and make a valid menu entry from it. I'll talk more about this shortly.
Now for the menu. Make yourself a new action, call it something meaningful (mine's called
Universal Mouse Menu) and start it like this:
(Start)
HOW TO USE: Copy from Start to End, and then paste into an action.
REFERENCE : See an example of pasting at alomware.com/paste.png
0001 Mouse: Move to desktop position "numpad5"
0002 Alert: Show a mouse menu "[[Mouse Menu]]"
(End)
Line 0001 just puts the mouse in the centre of the screen. Line 0002 is where we're going to spend the rest of our time.
The important thing to know here is in the help text for the "Alert: Show a mouse menu" command. I'll quote it:
QuoteSpecify each menu item on its own single line. Lines surrounded in double brackets [[Like This]] are disabled and intended for use as menu headings. Lines surrounded in single brackets [Like This] start a new sub-menu, and they're closed with a single line of <. A line of a single dash (-) puts a bar in the menu at that place.
So the key takeaways: a new menu heading is surrounded by square brackets, a heading that's just for display is surrounded by double square brackets, and when you hit the bottom of a menu and want to go back a level, it's a left chevron (which looks a bit like an arrow pointing left) on a line on its own.
So right now, all you have is a menu that has a title, currently set to "Mouse Menu." You can change that to anything you like, it's free text.
So let's say that you want your menu to have three main categories -- Office Programs, Utilities and Games. And perhaps some sub-categories of the Games category: Action and Casual.
Looking at the Help, we do this by (first opening line 2 for editing) adding headings, lines for separation, and hierarchical submenus as we wish.
So, just working from the above menu categories, we can update our menu code like this:
(Start)
HOW TO USE: Copy from Start to End, and then paste into an action.
REFERENCE : See an example of pasting at alomware.com/paste.png
0001 Mouse: Move to desktop position "numpad5"
0002 Alert: Show a mouse menu "[[Mouse Menu]]~[Office Programs]~<~[Utilities]~<~[Games]~[Action]~<~¬
[Casual]~"
(End)
If you try this just by double-clicking it in the Actions list, you'll see you've already made a menu that you can navigate through, using mouse or keyboard, completely as you'd expect.
No usable contents yet, though.
One nice thing about this is that you can decide on the structure you want, then just add appropriate entries in the category you want. And you can define categories that suit you, fit to the way you think and work.
An entry for a program you might want to run will look a bit like this:
Program name to be displayed,dos:program to run,icon=filename of icon file
That can get tedious quickly, particularly if your menu is going to contain a lot of programs. You don't necessarily need the full path to the program if it's on the path that Windows knows to look through, but it's safest if it's included. Which potentially means you need it twice: once for the program to run bit, and again for the icon.
Remember the complicated-looking action I gave you at the top of this post? What it does is opens a file navigator for you to find and choose a program you want to make a menu entry for.
Once you've picked your program, line 3 of the code dismantles the filename into separate (and reusable) bits, then makes a menu line for you, following the above structure, then pastes it to the current cursor position.
All you have to do -- and even that might not always be necessary -- is replace the program name at the beginning of the line with something of your choice that describes what it does.
For example, let's say you want to put Windows Notepad into a new entry in your Utilities section.
First, open the "Alert: Show a mouse menu" command by double-clicking on line 0002 in the action.
Next, put the cursor at the end of the line that says [Utilities] and press the Enter key to open up a new line in the Utilities section.
Next, press the
Alt-Win-P shortcut (or whichever key combo you chose to trigger the first action above) and navigate to
c:\windows (or wherever your Windows folder lives), click on
notepad.exe and click the
Open button.
This line magically appears:
notepad,dos:C:\Windows\notepad.exe,icon=C:\Windows\notepad.exeThe bit before the first comma is the filename without its extension. It's free text, so there's nothing to stop you changing the line to
Windows default plain text editor,dos:C:\Windows\notepad.exe,icon=C:\Windows\notepad.exeSo now, the whole action looks like this:
(Start)
HOW TO USE: Copy from Start to End, and then paste into an action.
REFERENCE : See an example of pasting at alomware.com/paste.png
0001 Mouse: Move to desktop position "numpad5"
0002 Alert: Show a mouse menu "[[Mouse Menu]]~[Office Programs]~<~[Utilities]~Windows default plain¬
text editor,dos:C:\Windows\notepad.exe,icon=C:\Windows\notepad.exe~<~[Games]~[Action]~<~[Casual]~"
(End)Rinse, as they say, and repeat. You can make these fairly big: my normal mouse menu has around 100 entries, all separated out into functional or themed groups. One, for instance, is a group called "Morning"" which just has a handful of programs that I almost always run first thing. In those cases, those programs also have entries in functional groups elsewhere in the menu system -- so yes, there's some duplication, and yes, it's on purpose.
You should set the trigger for the action to something you can remember and is easy for your fingers to find. I use
Control+Windows+U as, in my head, this is a
Universal menu but you can and should absolutely do what works for you.
Finally, Line 0003 of the
Alt-Win-P action at the top of this is an example of using a Regular Expression (RegEx) for search and replace. Paul and I worked together to make it work, as neither of us are RegEx experts, and if you need to mess with it, or understand better how it works, you should look for RegEx tutorials online. In my case, I find it difficult to keep in my head once I've solved a problem, I usually have to relearn it, almost from scratch, next time I need it, so please don't ask me about it! Anything else here, though, I'm happy to expand on. :)