Hi Bruce...
I tried to set the wait times as low as possible. Then on one occasion it took an extremely long time to load the page and i decided to raise the values since the script needs run correctly every time. I think there are some other ways to deal with page loads though. I haven't finished reading the KM documentation. (Other manuals have taken precedence lately!).
If you look at the screen shot I posted above you'll see next to the image container there is a slider. This adjusts for the amount of blur of the graphic. I found in one instance I needed to move it all the way to the right to recognize the image. You'll definitely need to experiment each time you use the "Click At Found Image" action. It's one of my favorite actions because it's so easy to implement.
That's another tricky bit. Tricky because sometimes vendors change the email address they send from. (They change quite a few other things too!) I got a lot of help from Christopher Stone as well as JMichaelTX and others on pulling my scripts together.
Setting up the email part is actually the easiest part of all of this. What you have to do is setup a Mail Rule that gets triggered when the email comes in and then runs an AppleScript in Mail.app (or other mail clients) that brings Safari forward then fires the KM script. Poke around in your mail applications preferences and look for "Rules" in Mail.app or Outlook. In the rules section one of the options after filtering the email based on the rule's conditions is to run an AppleScript.
KM can help with the bit that gets entered to call the specific KM script. The AppleScript is simple and here's what it looks like:
tell application "Safari"
if not running then run
activate
end tell
-- ignoring application responses
tell application "Keyboard Maestro Engine"
do script "028B720D-4B15-4A98-B289-CD87A27CEFE3"
-- or: do script "Move or Click Mouse"
-- or: do script "028B720D-4B15-4A98-B289-CD87A27CEFE3" with parameter "Whatever"
end tell
-- end ignoring
You have to write the first tell block but KM will write the second tell block for you and you can paste it into AppleScript then save the script. Then have your mail rule use that AppleScript. I name my AppleScripts by financial institution to keep them straight.
Next time you are in KM take a minute to look at the action where you set the keystroke to fire off the KM marco, you'll see "New Trigger" then "Or by script", click on the "Or by script" popup menu and you'll see AppleScript as an option. Once you select it, KM will generate the code to reference the KM macro you are creating. So it will always trigger that macro and no other macro.
That should get you going on having the email trigger the script. I think I need to add alerts to all my scripts and/or macros that tells me when they are running, or perhaps have AppleScript "speak text" that says "Script has been activated, Please wait." This is because a couple of times I opened mail and the script fired off and started to perform the action and I was in the middle of something. It was a momentary shock until I realized what was happening.
I will probably do something generic that can be used in all scripts, like a module. I have realized that when scripting using modular code seems to me the best way to go. Instead of always having to write the same code over and over, I can take blocks of code and plug them in where I need them.
So you may want to also consider adding some type of alert or writing a post-it note to place on your computer that says "Wait for mail rules to run" to remind yourself to give mail time to process the attached scripts to filtering rules you have setup. You'll have to decide what's best for you.