July 27, 2009

Think like a user, not a programmer

Filed under: Automation — Marcus Tettmar @ 3:23 pm

I just helped out a customer who was getting increasingly frustrated trying to get a macro to select a menu. The menu shortcut key was “g” and all he was trying to do was send Alt-g to the window. But whatever he tried he couldn’t get it to work.

Being an experienced programmer who had built Windows interfaces he had assumed that ALT-g (Alt together with “g”) would work:

Press ALT
Send>g
Release ALT

But nothing happened. He added waits in all sorts of various places but no cigar.

Eventually he called me up for a BeamYourScreen session and I took a look. I went back to basics, and tried the app out manually, making no assumptions. I entered ALT-G (g together with the ALT key) and found nothing happened. I then pressed the ALT key and released it. The app focused the first “File” submenu. I then hit “g” on its own and the required menu opened. Bingo.

Turns out the app doesn’t work the way either of us expected. The shortcuts should work when sent with the ALT key held down. But that wasn’t the case. One had to press ALT, release it, then send the shortcut character on its own. So the working code was:

Press ALT
Release ALT
Send>g

The mistake here was making assumptions based on our expectations and prior knowledge. A less experienced user may actually have got it working sooner by not taking anything for granted.

The trick to automating an app is to go back to basics, break it down and actually watch what you do. If my customer had actually tried it manually and taken a closer note of what exact keystrokes he had pushed, he would have made progress faster, instead of assuming that the app worked the way any UI guru would expect, and blaming the macro when it didn’t.

Think like a user not a programmer. To automate something first try it manually, write down or remember what sequence worked then replicate that in the macro – just as I preach in the Beginner’s Guide and Getting Started Guide.

No matter how technical you might be, this getting started guide is helpful.