Tuesday, April 17, 2007

Lesson 2: The Pop-up Menu

Well, here here we are at lesson two and you've already reduced your annoyance and saved yourself a tonne of time with the Text Sensitive Menu (TSM). And if you're like me you may have a hard time keeping track of all the items it the T.S. Menu. Have I got just the thing for you: the Pop-up Menu (PuM). The PuM can hold command strings or execute macros, just like the TSM, but you can pick these items from a visual menu rather than trying to remember them. So now that the hook has been baited, let's put it in the water and see what hits it.

Create a new PuM by clicking File>New>New Menu


The syntax for the PuM is pretty straight forward. The label (the name you want to show on the menu), then a 'space' character, then a 'colon' character, then the magic. Let's start with all those 'text-replacements' you setup in the TSM but can't remember to use. Since it's pretty straight forward I'll just show you what it looks like.



And here's the code (note: there are only three lines of code even though your browser may have wrapped them:

No Thanks :outp "Thank you for your concern but I don't need any non-perscription v!agr4."
Good Luck :outp "That is unfortunate about your current financial circumstances; I would help you, however I am already helping a wrongly deposed prince in Sierra Leone."
PPpbbbbtttt :outp "Your offer is very tempting as your rates seem to be very low, however I won't do my banking with someone who can't spell 'r3f1nanc3' correctly."


Since you have other things to do besides reply to spam all day (which I don't recommend by the way), here's another function of the PuM that will save you a tonne of time. Launch your favorite applications from the PuM.

It is insanely simple to to code the PuM to launch programs; just drag the icon into the Editor, and then....ummmm....ok, well there isn't another step.



Here is the code that is put into the Editor when I drop the program's icon into the Editor.
halo :run "$program files$\Microsoft Games\Halo\halo.exe"
And here is what the PuM looks like when I hit the trigger for it.



But after a program or two plus the text-replacements, things can get cluttered but here's how we can deal with that. You can create Sub-Menus to organize all the entries that are related.

To do this use the '>' (greater than) character to let QM know that the following is the name of the Sub-Menu. When you hit enter, the Editor automatically 'tab-indents' the lines that follow. Now you can move the line down into the Sub-Menu like this and drop in a couple of tabs to line everything up and then end the block with a '<' (less than) character so that your code looks like this.

Now you've got a place for that Text-Sensitive Menu 'run-off' that you can't seem to keep in your head. Plus, a quick menu for your most used programs.

So have at it and I'll see you next time cause the hook always brings you back.

Lesson 2: The Extra Mile

No comments: