Showing posts with label The Pou-up Menu. Show all posts
Showing posts with label The Pou-up Menu. Show all posts

Tuesday, May 1, 2007

!!! ALPHA ALERT !!!

Lookout! I just started using the new alpha of 2.2.0.6 and it's got some really nice features.
I'm not entirely sure because I can't compare to the 2.2.0.5 build but I think you will have these new (among others) soon
  • Popup menus: Expandable folders, bitmaps and more.
  • A global hot key to show Threads dialog can be specified in Options.
  • Vista compatibility in both 32 and 64 bit versions.
  • Macro and function properties: "Run in separate process", "Run As".

The appearance of the alpha code means that the beta should be out soon; I'd say less than a week or even THIS WEEK!

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

Lesson 2:The Extra Mile

Well, now that you've got your menu up and going, it has probably gone all Audrey II on you and has like a 100 lines in it by now. Like the Sub-menu, there is another way that you can further categorize the Pop-up Menu (PuM) by making several and have them tied to the specific program that you are currently using. But the problem with a bunch of PuMs is that, you have to remember all those triggers. So here's a plan to avoid that. I call it "Macro Stacking".

First split up your PuM items into program categories ( e.g. browsing, email, Excel actions, etc.) and create a new PuM for each category. Now, make a new macro with the trigger you want (mouse or keyboard or second keyboard). What you're going to do is use the "getwintext" string function to get the active window's Tittle Bar text and then use the "sel" function to determine which PuM is brought up.

Here is how it is coded:

_s.getwintext(win())
sel _s 2
case "*- Mozilla Firefox"
mac "Menu3"
case "Quick Macros - *"
mac "Menu2"
case "QM Help"
mac "Menu"


This is pretty straight forward but I will make a few notes. First the '_s' is a predefined local variable for a string. There are also numerous other predefined variables but I mostly use _s and _i (integer). It saves a line of code by not having to declare it. The '2' after 'sel _s' is a flag that tells QM that the values in the select case will/may contain wildcards. You can also tell QM that the case statements need to be case insensitive with the flag 1. Or, you can tell QM that the case statements are case insensitive AND may contain wildcards by adding the flags together and putting a 3 there.

So there you have it; one macro to rule them all using 'Macro Stacking'. Now you can make all kinds of PuMs without having to sift though all the macros/code or Sub-menus that don't apply to the situation at hand.

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

Lesson 2:The Pop-up Menu