Monday, June 25, 2007

BYE BYE BETA!!!

Well 2.2 is now gold! It's no longer beta and it's ready to roll.
There were a few upgrades to this version but only if you have Vista, otherwise, it seems to be a version history shake down.

I would like to see some of the new Vista toolbar settings in action though....hint, hint! 90)

Thursday, June 21, 2007

Lesson 6: Getting Stuck in the GUI Hacks

Getting Stuck in the GUI Hacks
GUI hacks are the processes that you have to create because you can't get at the option or method of doing something to/in a program. For example, a really ugly GUI Hack would be
  1. open Windows Explorer
  2. hit Alt-d and put in the directory you want to go to
  3. then hitting 'Tab' three times to get to the file list
  4. use the 'key' command to start spelling the name of the file you want so that it is selected
  5. type Ctl-c
  6. hit Alt-d to move to the address bar and put in the new directory
  7. hit 'Tab' three times to get to the file list
  8. hit Ctl-v

Of course no one would do this; that's what 'ren' or 'cop' is for but sometimes you just have to interact with program GUI dialogs. And God help me, I HATE GUI HACKS! There are just so many more things that can go wrong so many 'edge-cases' you have to account for...God help me but I hate them. Well, if you gotta you gotta so here's some ideas that might help.

Timing is everything in GUI hacking. If the dialog is slow to open, or if the field you need inside the dialog is slow to be drawn, or if...blah blah blah. The first thing I do to make sure my GUI hacks are going to work is put in 'wait's everywhere so that the macro 'paces' itself. Here's an example of that. Sometimes when I send emails via Outlook, I don't want a 'message receipt' nor do I want to keep a copy of the sent message, so I have a macro that changes the message property for me and then sends it. Here's what the dialog looks like.



As you can see, there are two check boxes I want to deselect; they can either be 'clicked' by the mouse (I find this less reliable for various reasons) or the values of the check boxes can be inverted by using keystrokes (Alt-r and Alt-n). First things first; I have to get the dialog to show up. I do that by using the "Accessible object actions" item in the "Windows, controls" button on the QM toolbar and drag the aiming reticle on top of the "Options..." button on the message I'm currently writing. This method works well enough but ask yourself what would happen if the toolbar that had that "Options..." button wasn't visible at the time; the macro would fail immediately (and so would my willowy grasp on sanity). I'd prefer a keyboard shortcut but I don't have one for it, so I make due. But now, I have to guess how long to wait for the dialog to show up before I start hitting my keystrokes....or do I?....Nope. Here's what I do.
0 WA "Message Options"
This is a version of the 'wait' command. The '0' tells QM to wait indefinitely for the window with the name "Message Options" to become 'active' ('WA'=wait till active). I pulled the window name directly from the QM Editor itself. When you have the editor open the status bar continually gives you information on both the cursor position and the window that it is currently hovering over. The window name is in the first row and comes just after the mouse position relative to the window. So now, when I start the macro, it 'clicks' the "Options..." button and waits for the dialog to become active; it then sends the keystrokes for the above check boxes and hits 'enter'. It then waits for the message itself to become active so that it can send the 'Send Message' command via an Alt-s keystroke.
spe 50
Acc option_a=acc("Options..." "DROPLIST" win(".*Message" "OpusApp" "" 0x200) "MsoCommandBar" "" 0x1001)
option_a.Mouse(1)
0 WA "Message Options"
'Ar
'An
'Y
0 WA "Message"
'As

Now you may ask about the second line from the bottom and say, "Gordon Bennett, not ALL your emails can be tittled 'Message'!"...ok, so maybe you wouldn't say that but someone did....probably.....might have....well, ok they could have said it give me that at least.... Well, this kind of gets into the 'win' function which I should cover another time in depth but let's suffice it to say that, it is case sensitive and can be anywhere within the window name. Here's what my window's tittle bar actually looks like with a standard message.
There it is; a macro with built rest stops (but smells better) for when you just 'have' to GUI hack.

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

Monday, June 18, 2007

Beta Alert: ROUND 2!

2.2.0.10 is out now.
Looks like Gintaras forgot to roll in a feature he'd promised on the forums.

  • Popup menu expandable folders: removed flag 64 (apply include/exclude to folders), and instead added /filterfolders.

Beta Alert!

New beta is now out (download here).
Not a lot of ground breaking things but some enhancements for the deep end programmers.

  • Better supports ActiveX controls.
  • Adding files to exe.

Monday, June 4, 2007

Paying the Automation Monkey

Well, I had an interesting discussion with a friend of mine the other day; let's call him "Dimitri". He told me about a reporting project that he was doing where his "superiors" were loath to allow him to automate. As you can tell from one of my posts, I'm not really hip to that sort of....well, I really can't express how I feel about that without offending a LOT of people and risking a visit from the FBI, Homeland Security, and theEYP (why the EYP ?...well, I can't into that either...but it was a total misunderstanding I swear!)...not to mention a courtesy call from the ELF. So, let's just say, "I am somewhat opposed to management outright denying permission to automate a re-occurring process." And what struck me most abhorrent about this situation was not the, capricious Jimmy Carter style micro-management of high-level technical staff, but the apparent lack of understanding of time/worker management or rather the limited understanding of what it costs to actually have people do things....No, I will say it plainly....The COMPLETE lack of understanding math....simple A+B+C+D+E=F kind of math. These are people that manage people for a LIVING for crying out loud; this is not a hobby they do; this IS what they do to eat and buy jet-skis. Stop drinking theKool Aid and take a work-force management course for crying out loud....ehmmm...ok, I'm done....for now....anyway...back to Dimitri. Here's the story.

For the next couple of years,
Dimitri is going to be running a diagnostic on systems within his organization and receive a small amount of output from that process. One of his higher-ups, wanted him to put that info into an email and send it out to everyone on a distribution list. He said that he could do that but none of the info from the diagnostics would be useful or informative for anyone but himself and to send that out would be a waste of time for him and everyone on the list. About that time, another higher-up got involved and started demanding the info be in a file and not just in an email and not just any file format but a spreadsheet. At that point, Dimitri went to his supervisor (yes, this is now the 3rd higher-up mixed up in this mess) and told him about the problem this TPS report has now become. His boss asked him if he could automate the file update process to which my buddy said yes, it is very easy unless you want it in Excel, then it will take at least a 2-3 hours for him to get some info on Perl/Excel functions (or maybe have me code something up in Quick Macros for him). After hearing how long it would take to automate, one of the two original higher-ups came to my friend's office and said, "It sounds like it's going to take more time to automate this than it will to just do it; so just do it manually for the next two years rather than automating it." Keep in mind that this person was not even Dimitri's boss.

And, it is at this point that I want to step-in and do a reality check..."Advertising doesn't cost; it pays."...Ok, well I don't have a cool saying for automation like the ad people do for advertising; well, there's "If you do something more than once, you're a sucker" but that seems overly rude at times. But, even that doesn't get to the point here. The point is that if you don't automate it, your going to spend more than that 1-3 hours to automate it. Here's why.

Let's say
Dimitri spends five minutes actually doing the process every week. He's going to need to train someone to do it in case he gets hit by a bus (or, God forbid, takes a vacation day). That person will, at some point, realize that they will need to show someone else how to do it as well, just in case. So, now we have a 15 minute training session for the first backup and a 25 minute training session for the second backup. But, if either the first or second backup needs to actually do the process, it's going to take them probably 15 and 25 minutes respectively to do it because it usually 'jumps up at them' and they'll have to scramble to do it which means they'll have to go track down the instructions and then go hunt down their id/password to get into the system to get the data file. So here's how it actually breaks down:

Primary and Secondary 15 min X 2 = 30 min
Secondary and Tertiary 25 min X 2 = 50 min
Running the Process ea wk 510 min = 510
All Goings-back and forth
talking @ automation 60 min = 60

Total 650 min or 10.8 HOURS

10 HOURS and 50 MINUTES! HOLY COW!!! And that doesn't even count the times that the secondary and tertiary run this process. The very worst case scenario for him to automate this project: 3 hours. Yeah, "It sounds like it's going to take more time to automate this than it will to just do it; so just do it manually for the next two years rather than automating it"...IN A PIG'S EYE! Look, I'm the second or third guy to admit that there are times when automating things just doesn't make sense but if you're going to count the cost then count the freakin' cost. There are times, like this one, where it is too expensive to not automate a project and that fact should be painfully obvious even to managers who manage overtime exempt employees. I'll lay it out for you this way:
  1. An employee only has "x" amount of minutes in a day
  2. No task takes "0" minutes to complete.
Have your six-year-old add it up for you!

Ok, ok...so, I'm coming off a little over board here; but it is a hard earned sense of indignation that comes from years of seeing "management" (read: "people who get paid more than the 'workers' but don't actually 'know' how to actually 'manage' them") going out of their way to not onlystifle worker productivity in the area of automation but actively seek out the proponents and developers of that automation to discipline with reprimands and down-checks on their yearlyevals.
It's all a big crazy game that they are playing up there and only God knows the rules cause to me it looks like a varsity game of Calvin-Ball.

Simply put, this is what I'm trying to say, "Automation doesn't cost you time; it pays everyday with interest."....GAHHHH....that was terrible!...see, I still don't have a good catch-phrase for automation....let's just stick with this:

"If you do something twice, you're a sucker."